// This file is licensed under the Elastic License 2.0. Copyright 2021 StarRocks Limited.

#include <gtest/gtest.h>

#include "exprs/vectorized/decimal_cast_expr_test_helper.h"
#include "runtime/primitive_type.h"
#include "runtime/vectorized/time_types.h"

namespace starrocks::vectorized {
PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{9, 0, "13886024", 9, 0, "13886024", "false"},
                                    {9, 0, "276308692", 9, 0, "276308692", "false"},
                                    {9, 0, "247867855", 9, 0, "247867855", "false"},
                                    {9, 0, "721520346", 9, 0, "721520346", "false"},
                                    {9, 0, "-118208734", 9, 0, "-118208734", "false"},
                                    {9, 0, "430145799", 9, 0, "430145799", "false"},
                                    {9, 0, "-380513922", 9, 0, "-380513922", "false"},
                                    {9, 0, "248836658", 9, 0, "248836658", "false"},
                                    {9, 0, "126204238", 9, 0, "126204238", "false"},
                                    {9, 0, "207794705", 9, 0, "207794705", "false"},
                                    {9, 0, "-431188397", 9, 0, "-431188397", "false"},
                                    {9, 0, "766131673", 9, 0, "766131673", "false"},
                                    {9, 0, "-962707544", 9, 0, "-962707544", "false"},
                                    {9, 0, "-985155602", 9, 0, "-985155602", "false"},
                                    {9, 0, "-889845673", 9, 0, "-889845673", "false"},
                                    {9, 0, "982322678", 9, 0, "982322678", "false"},
                                    {9, 0, "-999999972", 9, 0, "-999999972", "false"},
                                    {9, 0, "5394", 9, 0, "5394", "false"},
                                    {9, 0, "5477", 9, 0, "5477", "false"},
                                    {9, 0, "-36329321", 9, 0, "-36329321", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal32p9s2Abnormal) {
    CastTestCaseArray test_cases = {{9, 0, "800008316", 9, 2, "", "true"},  {9, 0, "808680616", 9, 2, "", "true"},
                                    {9, 0, "-129570339", 9, 2, "", "true"}, {9, 0, "330580747", 9, 2, "", "true"},
                                    {9, 0, "953517071", 9, 2, "", "true"},  {9, 0, "-903115980", 9, 2, "", "true"},
                                    {9, 0, "-149914789", 9, 2, "", "true"}, {9, 0, "-999996823", 9, 2, "", "true"},
                                    {9, 0, "732574760", 9, 2, "", "true"},  {9, 0, "680939836", 9, 2, "", "true"},
                                    {9, 0, "-103285250", 9, 2, "", "true"}, {9, 0, "840063309", 9, 2, "", "true"},
                                    {9, 0, "-999997579", 9, 2, "", "true"}, {9, 0, "-921385402", 9, 2, "", "true"},
                                    {9, 0, "847865866", 9, 2, "", "true"},  {9, 0, "-966520718", 9, 2, "", "true"},
                                    {9, 0, "395622947", 9, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {{9, 0, "349", 9, 2, "349", "false"},
                                    {9, 0, "457132", 9, 2, "457132", "false"},
                                    {9, 0, "590985", 9, 2, "590985", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {{9, 0, "255059591", 9, 9, "", "true"},  {9, 0, "2017", 9, 9, "", "true"},
                                    {9, 0, "-527987949", 9, 9, "", "true"}, {9, 0, "366830980", 9, 9, "", "true"},
                                    {9, 0, "-201044416", 9, 9, "", "true"}, {9, 0, "-997361790", 9, 9, "", "true"},
                                    {9, 0, "663211470", 9, 9, "", "true"},  {9, 0, "-238204879", 9, 9, "", "true"},
                                    {9, 0, "189311954", 9, 9, "", "true"},  {9, 0, "-465038410", 9, 9, "", "true"},
                                    {9, 0, "-837261642", 9, 9, "", "true"}, {9, 0, "491932220", 9, 9, "", "true"},
                                    {9, 0, "-128645299", 9, 9, "", "true"}, {9, 0, "-140193857", 9, 9, "", "true"},
                                    {9, 0, "-686189855", 9, 9, "", "true"}, {9, 0, "-688373547", 9, 9, "", "true"},
                                    {9, 0, "542463618", 9, 9, "", "true"},  {9, 0, "591661313", 9, 9, "", "true"},
                                    {9, 0, "801340060", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal32p9s9Normal) {
    CastTestCaseArray test_cases = {{9, 0, "0", 9, 9, "0", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal32p7s4Abnormal) {
    CastTestCaseArray test_cases = {{9, 0, "-734770478", 7, 4, "", "true"}, {9, 0, "438310991", 7, 4, "", "true"},
                                    {9, 0, "212715250", 7, 4, "", "true"},  {9, 0, "-662566120", 7, 4, "", "true"},
                                    {9, 0, "762009493", 7, 4, "", "true"},  {9, 0, "-513538076", 7, 4, "", "true"},
                                    {9, 0, "384747367", 7, 4, "", "true"},  {9, 0, "304767602", 7, 4, "", "true"},
                                    {9, 0, "-786037613", 7, 4, "", "true"}, {9, 0, "-999999977", 7, 4, "", "true"},
                                    {9, 0, "-73489526", 7, 4, "", "true"},  {9, 0, "-975366390", 7, 4, "", "true"},
                                    {9, 0, "-999836050", 7, 4, "", "true"}, {9, 0, "-99980287", 7, 4, "", "true"},
                                    {9, 0, "-869492542", 7, 4, "", "true"}, {9, 0, "-765747691", 7, 4, "", "true"},
                                    {9, 0, "-208851377", 7, 4, "", "true"}, {9, 0, "947232486", 7, 4, "", "true"},
                                    {9, 0, "597722726", 7, 4, "", "true"},  {9, 0, "-413328303", 7, 4, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {
            {9, 0, "125544288", 18, 0, "125544288", "false"},   {9, 0, "-502133973", 18, 0, "-502133973", "false"},
            {9, 0, "97436", 18, 0, "97436", "false"},           {9, 0, "724190322", 18, 0, "724190322", "false"},
            {9, 0, "658071448", 18, 0, "658071448", "false"},   {9, 0, "-88442895", 18, 0, "-88442895", "false"},
            {9, 0, "716079603", 18, 0, "716079603", "false"},   {9, 0, "-936530068", 18, 0, "-936530068", "false"},
            {9, 0, "-921462025", 18, 0, "-921462025", "false"}, {9, 0, "752479910", 18, 0, "752479910", "false"},
            {9, 0, "-238085838", 18, 0, "-238085838", "false"}, {9, 0, "23220", 18, 0, "23220", "false"},
            {9, 0, "346178178", 18, 0, "346178178", "false"},   {9, 0, "434690200", 18, 0, "434690200", "false"},
            {9, 0, "-305151830", 18, 0, "-305151830", "false"}, {9, 0, "18398931", 18, 0, "18398931", "false"},
            {9, 0, "181824805", 18, 0, "181824805", "false"},   {9, 0, "-669058484", 18, 0, "-669058484", "false"},
            {9, 0, "453585527", 18, 0, "453585527", "false"},   {9, 0, "-588284769", 18, 0, "-588284769", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {
            {9, 0, "-192277746", 18, 2, "-192277746", "false"}, {9, 0, "842523876", 18, 2, "842523876", "false"},
            {9, 0, "271350", 18, 2, "271350", "false"},         {9, 0, "-878827456", 18, 2, "-878827456", "false"},
            {9, 0, "-827168840", 18, 2, "-827168840", "false"}, {9, 0, "-289966453", 18, 2, "-289966453", "false"},
            {9, 0, "564594848", 18, 2, "564594848", "false"},   {9, 0, "26909549", 18, 2, "26909549", "false"},
            {9, 0, "-128277611", 18, 2, "-128277611", "false"}, {9, 0, "-184801137", 18, 2, "-184801137", "false"},
            {9, 0, "924041475", 18, 2, "924041475", "false"},   {9, 0, "-401681727", 18, 2, "-401681727", "false"},
            {9, 0, "509059693", 18, 2, "509059693", "false"},   {9, 0, "-67826245", 18, 2, "-67826245", "false"},
            {9, 0, "518605111", 18, 2, "518605111", "false"},   {9, 0, "-999999980", 18, 2, "-999999980", "false"},
            {9, 0, "-521320657", 18, 2, "-521320657", "false"}, {9, 0, "888632", 18, 2, "888632", "false"},
            {9, 0, "662345237", 18, 2, "662345237", "false"},   {9, 0, "385576488", 18, 2, "385576488", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {
            {9, 0, "300521343", 18, 9, "300521343", "false"},   {9, 0, "-860373001", 18, 9, "-860373001", "false"},
            {9, 0, "-446896298", 18, 9, "-446896298", "false"}, {9, 0, "825847007", 18, 9, "825847007", "false"},
            {9, 0, "66229839", 18, 9, "66229839", "false"},     {9, 0, "1", 18, 9, "1", "false"},
            {9, 0, "755887876", 18, 9, "755887876", "false"},   {9, 0, "424973202", 18, 9, "424973202", "false"},
            {9, 0, "-1047866", 18, 9, "-1047866", "false"},     {9, 0, "-325295436", 18, 9, "-325295436", "false"},
            {9, 0, "-885736009", 18, 9, "-885736009", "false"}, {9, 0, "-373519254", 18, 9, "-373519254", "false"},
            {9, 0, "-864916945", 18, 9, "-864916945", "false"}, {9, 0, "-122474345", 18, 9, "-122474345", "false"},
            {9, 0, "-721683886", 18, 9, "-721683886", "false"}, {9, 0, "500283075", 18, 9, "500283075", "false"},
            {9, 0, "-900078718", 18, 9, "-900078718", "false"}, {9, 0, "616235690", 18, 9, "616235690", "false"},
            {9, 0, "-825253836", 18, 9, "-825253836", "false"}, {9, 0, "-451083554", 18, 9, "-451083554", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {{9, 0, "-992603608", 18, 18, "", "true"}, {9, 0, "54671612", 18, 18, "", "true"},
                                    {9, 0, "-389050073", 18, 18, "", "true"}, {9, 0, "94674052", 18, 18, "", "true"},
                                    {9, 0, "-999999993", 18, 18, "", "true"}, {9, 0, "-704629059", 18, 18, "", "true"},
                                    {9, 0, "951103858", 18, 18, "", "true"},  {9, 0, "821634822", 18, 18, "", "true"},
                                    {9, 0, "-999999937", 18, 18, "", "true"}, {9, 0, "-416429152", 18, 18, "", "true"},
                                    {9, 0, "-130458600", 18, 18, "", "true"}, {9, 0, "-192780155", 18, 18, "", "true"},
                                    {9, 0, "977953067", 18, 18, "", "true"},  {9, 0, "-681452134", 18, 18, "", "true"},
                                    {9, 0, "945776648", 18, 18, "", "true"},  {9, 0, "130237362", 18, 18, "", "true"},
                                    {9, 0, "168", 18, 18, "", "true"},        {9, 0, "-216535615", 18, 18, "", "true"},
                                    {9, 0, "362098746", 18, 18, "", "true"},  {9, 0, "583116161", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal64p15s13Abnormal) {
    CastTestCaseArray test_cases = {{9, 0, "-997577055", 15, 13, "", "true"}, {9, 0, "34145826", 15, 13, "", "true"},
                                    {9, 0, "-1802859", 15, 13, "", "true"},   {9, 0, "-741418420", 15, 13, "", "true"},
                                    {9, 0, "-247327105", 15, 13, "", "true"}, {9, 0, "-436204839", 15, 13, "", "true"},
                                    {9, 0, "741761395", 15, 13, "", "true"},  {9, 0, "-728912728", 15, 13, "", "true"},
                                    {9, 0, "-999999883", 15, 13, "", "true"}, {9, 0, "-699917330", 15, 13, "", "true"},
                                    {9, 0, "-999998061", 15, 13, "", "true"}, {9, 0, "-771393848", 15, 13, "", "true"},
                                    {9, 0, "312338486", 15, 13, "", "true"},  {9, 0, "797153395", 15, 13, "", "true"},
                                    {9, 0, "-641658736", 15, 13, "", "true"}, {9, 0, "633678315", 15, 13, "", "true"},
                                    {9, 0, "68727605", 15, 13, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{9, 0, "76", 15, 13, "76", "false"},
                                    {9, 0, "183192", 15, 13, "183192", "false"},
                                    {9, 0, "0", 15, 13, "0", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {{9, 0, "601886824", 38, 0, "601886824", "false"},
                                    {9, 0, "136784339", 38, 0, "136784339", "false"},
                                    {9, 0, "60249920", 38, 0, "60249920", "false"},
                                    {9, 0, "341975032", 38, 0, "341975032", "false"},
                                    {9, 0, "272157472", 38, 0, "272157472", "false"},
                                    {9, 0, "687045026", 38, 0, "687045026", "false"},
                                    {9, 0, "61106", 38, 0, "61106", "false"},
                                    {9, 0, "-523892931", 38, 0, "-523892931", "false"},
                                    {9, 0, "696692525", 38, 0, "696692525", "false"},
                                    {9, 0, "-906452330", 38, 0, "-906452330", "false"},
                                    {9, 0, "1130444", 38, 0, "1130444", "false"},
                                    {9, 0, "719711620", 38, 0, "719711620", "false"},
                                    {9, 0, "-309225563", 38, 0, "-309225563", "false"},
                                    {9, 0, "-556000995", 38, 0, "-556000995", "false"},
                                    {9, 0, "-999943138", 38, 0, "-999943138", "false"},
                                    {9, 0, "126387820", 38, 0, "126387820", "false"},
                                    {9, 0, "47", 38, 0, "47", "false"},
                                    {9, 0, "-572325474", 38, 0, "-572325474", "false"},
                                    {9, 0, "68821229", 38, 0, "68821229", "false"},
                                    {9, 0, "-925445962", 38, 0, "-925445962", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {
            {9, 0, "-29860620", 38, 2, "-29860620", "false"},   {9, 0, "6546898", 38, 2, "6546898", "false"},
            {9, 0, "-53720722", 38, 2, "-53720722", "false"},   {9, 0, "-999998961", 38, 2, "-999998961", "false"},
            {9, 0, "737837784", 38, 2, "737837784", "false"},   {9, 0, "-363719703", 38, 2, "-363719703", "false"},
            {9, 0, "196205369", 38, 2, "196205369", "false"},   {9, 0, "729597642", 38, 2, "729597642", "false"},
            {9, 0, "194210420", 38, 2, "194210420", "false"},   {9, 0, "600125520", 38, 2, "600125520", "false"},
            {9, 0, "-305011730", 38, 2, "-305011730", "false"}, {9, 0, "40095391", 38, 2, "40095391", "false"},
            {9, 0, "-470219937", 38, 2, "-470219937", "false"}, {9, 0, "432212302", 38, 2, "432212302", "false"},
            {9, 0, "640229042", 38, 2, "640229042", "false"},   {9, 0, "790184611", 38, 2, "790184611", "false"},
            {9, 0, "62041387", 38, 2, "62041387", "false"},     {9, 0, "580874517", 38, 2, "580874517", "false"},
            {9, 0, "362501640", 38, 2, "362501640", "false"},   {9, 0, "-831855964", 38, 2, "-831855964", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {{9, 0, "-769511024", 38, 9, "-769511024", "false"},
                                    {9, 0, "-985517441", 38, 9, "-985517441", "false"},
                                    {9, 0, "-999996185", 38, 9, "-999996185", "false"},
                                    {9, 0, "1283", 38, 9, "1283", "false"},
                                    {9, 0, "634352169", 38, 9, "634352169", "false"},
                                    {9, 0, "595422312", 38, 9, "595422312", "false"},
                                    {9, 0, "785339922", 38, 9, "785339922", "false"},
                                    {9, 0, "735195883", 38, 9, "735195883", "false"},
                                    {9, 0, "-387694676", 38, 9, "-387694676", "false"},
                                    {9, 0, "973329075", 38, 9, "973329075", "false"},
                                    {9, 0, "567", 38, 9, "567", "false"},
                                    {9, 0, "-985726671", 38, 9, "-985726671", "false"},
                                    {9, 0, "166148616", 38, 9, "166148616", "false"},
                                    {9, 0, "-729081057", 38, 9, "-729081057", "false"},
                                    {9, 0, "291294", 38, 9, "291294", "false"},
                                    {9, 0, "1482420", 38, 9, "1482420", "false"},
                                    {9, 0, "-335335010", 38, 9, "-335335010", "false"},
                                    {9, 0, "427652641", 38, 9, "427652641", "false"},
                                    {9, 0, "-506286521", 38, 9, "-506286521", "false"},
                                    {9, 0, "-911817134", 38, 9, "-911817134", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {{9, 0, "-524262273", 38, 13, "-524262273", "false"},
                                    {9, 0, "-592711361", 38, 13, "-592711361", "false"},
                                    {9, 0, "-941139205", 38, 13, "-941139205", "false"},
                                    {9, 0, "22781563", 38, 13, "22781563", "false"},
                                    {9, 0, "789170687", 38, 13, "789170687", "false"},
                                    {9, 0, "709385889", 38, 13, "709385889", "false"},
                                    {9, 0, "63864330", 38, 13, "63864330", "false"},
                                    {9, 0, "960212951", 38, 13, "960212951", "false"},
                                    {9, 0, "-282888328", 38, 13, "-282888328", "false"},
                                    {9, 0, "-682674692", 38, 13, "-682674692", "false"},
                                    {9, 0, "16", 38, 13, "16", "false"},
                                    {9, 0, "41", 38, 13, "41", "false"},
                                    {9, 0, "937713978", 38, 13, "937713978", "false"},
                                    {9, 0, "-999999981", 38, 13, "-999999981", "false"},
                                    {9, 0, "20691663", 38, 13, "20691663", "false"},
                                    {9, 0, "675159952", 38, 13, "675159952", "false"},
                                    {9, 0, "-999999992", 38, 13, "-999999992", "false"},
                                    {9, 0, "-152180889", 38, 13, "-152180889", "false"},
                                    {9, 0, "-269822096", 38, 13, "-269822096", "false"},
                                    {9, 0, "-891184389", 38, 13, "-891184389", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {
            {9, 0, "22855", 38, 18, "22855", "false"},           {9, 0, "655861841", 38, 18, "655861841", "false"},
            {9, 0, "-743086945", 38, 18, "-743086945", "false"}, {9, 0, "-290978121", 38, 18, "-290978121", "false"},
            {9, 0, "-128925318", 38, 18, "-128925318", "false"}, {9, 0, "682680489", 38, 18, "682680489", "false"},
            {9, 0, "-188529031", 38, 18, "-188529031", "false"}, {9, 0, "-208853703", 38, 18, "-208853703", "false"},
            {9, 0, "994614056", 38, 18, "994614056", "false"},   {9, 0, "-269507821", 38, 18, "-269507821", "false"},
            {9, 0, "-981331263", 38, 18, "-981331263", "false"}, {9, 0, "18631162", 38, 18, "18631162", "false"},
            {9, 0, "697409913", 38, 18, "697409913", "false"},   {9, 0, "-770972625", 38, 18, "-770972625", "false"},
            {9, 0, "859876558", 38, 18, "859876558", "false"},   {9, 0, "139610540", 38, 18, "139610540", "false"},
            {9, 0, "-886505317", 38, 18, "-886505317", "false"}, {9, 0, "-999999998", 38, 18, "-999999998", "false"},
            {9, 0, "-999731680", 38, 18, "-999731680", "false"}, {9, 0, "189381066", 38, 18, "189381066", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal128p35s30Abnormal) {
    CastTestCaseArray test_cases = {{9, 0, "-999534571", 35, 30, "", "true"}, {9, 0, "-999999929", 35, 30, "", "true"},
                                    {9, 0, "-890608345", 35, 30, "", "true"}, {9, 0, "-513398956", 35, 30, "", "true"},
                                    {9, 0, "-500869748", 35, 30, "", "true"}, {9, 0, "223613609", 35, 30, "", "true"},
                                    {9, 0, "885719815", 35, 30, "", "true"},  {9, 0, "-410293869", 35, 30, "", "true"},
                                    {9, 0, "-999999940", 35, 30, "", "true"}, {9, 0, "-401607754", 35, 30, "", "true"},
                                    {9, 0, "-581033924", 35, 30, "", "true"}, {9, 0, "-826704758", 35, 30, "", "true"},
                                    {9, 0, "-845371809", 35, 30, "", "true"}, {9, 0, "-522012143", 35, 30, "", "true"},
                                    {9, 0, "-999999986", 35, 30, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s0ToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {{9, 0, "5", 35, 30, "5", "false"},
                                    {9, 0, "-78030840", 35, 30, "-78030840", "false"},
                                    {9, 0, "15144224", 35, 30, "15144224", "false"},
                                    {9, 0, "80834757", 35, 30, "80834757", "false"},
                                    {9, 0, "11801617", 35, 30, "11801617", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{9, 2, "2839355.28", 9, 0, "2839355", "false"},
                                    {9, 2, "-4252277.66", 9, 0, "-4252278", "false"},
                                    {9, 2, "13422.53", 9, 0, "13423", "false"},
                                    {9, 2, "-9999999.78", 9, 0, "-10000000", "false"},
                                    {9, 2, "-6148076.61", 9, 0, "-6148077", "false"},
                                    {9, 2, "-2484423.22", 9, 0, "-2484423", "false"},
                                    {9, 2, "-7666928.91", 9, 0, "-7666929", "false"},
                                    {9, 2, "-9533969.33", 9, 0, "-9533969", "false"},
                                    {9, 2, "-190254.37", 9, 0, "-190254", "false"},
                                    {9, 2, "2863553.67", 9, 0, "2863554", "false"},
                                    {9, 2, "85863.86", 9, 0, "85864", "false"},
                                    {9, 2, "25110.08", 9, 0, "25110", "false"},
                                    {9, 2, "-7036274.37", 9, 0, "-7036274", "false"},
                                    {9, 2, "-9997387.58", 9, 0, "-9997388", "false"},
                                    {9, 2, "-6748509.89", 9, 0, "-6748510", "false"},
                                    {9, 2, "-9999999.95", 9, 0, "-10000000", "false"},
                                    {9, 2, "-9994778.47", 9, 0, "-9994778", "false"},
                                    {9, 2, "-1846412.40", 9, 0, "-1846412", "false"},
                                    {9, 2, "0.01", 9, 0, "0", "false"},
                                    {9, 2, "272218.25", 9, 0, "272218", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {
            {9, 2, "-6942452.69", 9, 2, "-6942452.69", "false"}, {9, 2, "22.31", 9, 2, "22.31", "false"},
            {9, 2, "-1412380.75", 9, 2, "-1412380.75", "false"}, {9, 2, "-2326852.57", 9, 2, "-2326852.57", "false"},
            {9, 2, "-9709025.77", 9, 2, "-9709025.77", "false"}, {9, 2, "-9999999.68", 9, 2, "-9999999.68", "false"},
            {9, 2, "-8819878.46", 9, 2, "-8819878.46", "false"}, {9, 2, "-9999991.11", 9, 2, "-9999991.11", "false"},
            {9, 2, "-3797624.34", 9, 2, "-3797624.34", "false"}, {9, 2, "-1572346.35", 9, 2, "-1572346.35", "false"},
            {9, 2, "-1238496.32", 9, 2, "-1238496.32", "false"}, {9, 2, "1373488.96", 9, 2, "1373488.96", "false"},
            {9, 2, "290.71", 9, 2, "290.71", "false"},           {9, 2, "-3775335.26", 9, 2, "-3775335.26", "false"},
            {9, 2, "6500135.03", 9, 2, "6500135.03", "false"},   {9, 2, "4444079.61", 9, 2, "4444079.61", "false"},
            {9, 2, "8355004.30", 9, 2, "8355004.30", "false"},   {9, 2, "-4455173.94", 9, 2, "-4455173.94", "false"},
            {9, 2, "6259928.12", 9, 2, "6259928.12", "false"},   {9, 2, "805033.78", 9, 2, "805033.78", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {{9, 2, "-6321487.78", 9, 9, "", "true"}, {9, 2, "159590.00", 9, 9, "", "true"},
                                    {9, 2, "-390693.91", 9, 9, "", "true"},  {9, 2, "-2334590.99", 9, 9, "", "true"},
                                    {9, 2, "7538480.46", 9, 9, "", "true"},  {9, 2, "6847861.63", 9, 9, "", "true"},
                                    {9, 2, "-9000355.78", 9, 9, "", "true"}, {9, 2, "6450097.69", 9, 9, "", "true"},
                                    {9, 2, "5457500.71", 9, 9, "", "true"},  {9, 2, "-4046472.03", 9, 9, "", "true"},
                                    {9, 2, "6693846.90", 9, 9, "", "true"},  {9, 2, "3673849.84", 9, 9, "", "true"},
                                    {9, 2, "-9999908.78", 9, 9, "", "true"}, {9, 2, "9.80", 9, 9, "", "true"},
                                    {9, 2, "-5303962.81", 9, 9, "", "true"}, {9, 2, "10.34", 9, 9, "", "true"},
                                    {9, 2, "-6343370.46", 9, 9, "", "true"}, {9, 2, "2641198.91", 9, 9, "", "true"},
                                    {9, 2, "-767554.64", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal32p9s9Normal) {
    CastTestCaseArray test_cases = {{9, 2, "1.05", 9, 9, "1.050000000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal32p7s4Abnormal) {
    CastTestCaseArray test_cases = {{9, 2, "7123510.03", 7, 4, "", "true"},  {9, 2, "5683226.13", 7, 4, "", "true"},
                                    {9, 2, "-6096495.59", 7, 4, "", "true"}, {9, 2, "3356831.51", 7, 4, "", "true"},
                                    {9, 2, "-9989004.17", 7, 4, "", "true"}, {9, 2, "3096051.46", 7, 4, "", "true"},
                                    {9, 2, "-1959871.96", 7, 4, "", "true"}, {9, 2, "-964721.22", 7, 4, "", "true"},
                                    {9, 2, "5774911.51", 7, 4, "", "true"},  {9, 2, "9060274.22", 7, 4, "", "true"},
                                    {9, 2, "-9254721.12", 7, 4, "", "true"}, {9, 2, "-9998633.83", 7, 4, "", "true"},
                                    {9, 2, "5646015.75", 7, 4, "", "true"},  {9, 2, "-9998801.85", 7, 4, "", "true"},
                                    {9, 2, "8130696.46", 7, 4, "", "true"},  {9, 2, "-1042970.29", 7, 4, "", "true"},
                                    {9, 2, "-1122040.23", 7, 4, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal32p7s4Normal) {
    CastTestCaseArray test_cases = {{9, 2, "-198410.60", 7, 4, "-198410.6000", "false"},
                                    {9, 2, "1194.29", 7, 4, "1194.2900", "false"},
                                    {9, 2, "27.88", 7, 4, "27.8800", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {{9, 2, "-2107069.35", 18, 0, "-2107069", "false"},
                                    {9, 2, "-2376145.72", 18, 0, "-2376146", "false"},
                                    {9, 2, "-79198.34", 18, 0, "-79198", "false"},
                                    {9, 2, "-5089000.13", 18, 0, "-5089000", "false"},
                                    {9, 2, "-7384188.33", 18, 0, "-7384188", "false"},
                                    {9, 2, "-2717978.50", 18, 0, "-2717979", "false"},
                                    {9, 2, "9199371.14", 18, 0, "9199371", "false"},
                                    {9, 2, "0.85", 18, 0, "1", "false"},
                                    {9, 2, "-123713.13", 18, 0, "-123713", "false"},
                                    {9, 2, "8132847.87", 18, 0, "8132848", "false"},
                                    {9, 2, "-6491265.11", 18, 0, "-6491265", "false"},
                                    {9, 2, "-6056005.72", 18, 0, "-6056006", "false"},
                                    {9, 2, "6024141.04", 18, 0, "6024141", "false"},
                                    {9, 2, "1446075.04", 18, 0, "1446075", "false"},
                                    {9, 2, "-6878226.60", 18, 0, "-6878227", "false"},
                                    {9, 2, "-7724144.17", 18, 0, "-7724144", "false"},
                                    {9, 2, "0.00", 18, 0, "0", "false"},
                                    {9, 2, "3455482.26", 18, 0, "3455482", "false"},
                                    {9, 2, "0.24", 18, 0, "0", "false"},
                                    {9, 2, "-330409.18", 18, 0, "-330409", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {{9, 2, "-3267052.99", 18, 2, "-3267052.99", "false"},
                                    {9, 2, "-983790.37", 18, 2, "-983790.37", "false"},
                                    {9, 2, "0.60", 18, 2, "0.60", "false"},
                                    {9, 2, "-1344587.46", 18, 2, "-1344587.46", "false"},
                                    {9, 2, "-1138205.28", 18, 2, "-1138205.28", "false"},
                                    {9, 2, "9320125.15", 18, 2, "9320125.15", "false"},
                                    {9, 2, "-3278673.05", 18, 2, "-3278673.05", "false"},
                                    {9, 2, "-9999992.38", 18, 2, "-9999992.38", "false"},
                                    {9, 2, "3319234.58", 18, 2, "3319234.58", "false"},
                                    {9, 2, "-6751965.00", 18, 2, "-6751965", "false"},
                                    {9, 2, "-5608462.82", 18, 2, "-5608462.82", "false"},
                                    {9, 2, "9553399.45", 18, 2, "9553399.45", "false"},
                                    {9, 2, "-8160680.57", 18, 2, "-8160680.57", "false"},
                                    {9, 2, "-4706980.65", 18, 2, "-4706980.65", "false"},
                                    {9, 2, "-9999999.48", 18, 2, "-9999999.48", "false"},
                                    {9, 2, "-9999140.16", 18, 2, "-9999140.16", "false"},
                                    {9, 2, "5461069.98", 18, 2, "5461069.98", "false"},
                                    {9, 2, "-6578439.33", 18, 2, "-6578439.33", "false"},
                                    {9, 2, "-8146147.40", 18, 2, "-8146147.40", "false"},
                                    {9, 2, "-5546225.55", 18, 2, "-5546225.55", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {{9, 2, "9323092.84", 18, 9, "9323092.840000000", "false"},
                                    {9, 2, "8477418.63", 18, 9, "8477418.630000000", "false"},
                                    {9, 2, "-3442452.20", 18, 9, "-3442452.200000000", "false"},
                                    {9, 2, "3174311.14", 18, 9, "3174311.140000000", "false"},
                                    {9, 2, "6.93", 18, 9, "6.930000000", "false"},
                                    {9, 2, "7413174.37", 18, 9, "7413174.370000000", "false"},
                                    {9, 2, "490957.08", 18, 9, "490957.080000000", "false"},
                                    {9, 2, "-9999995.83", 18, 9, "-9999995.830000000", "false"},
                                    {9, 2, "-5367435.97", 18, 9, "-5367435.970000000", "false"},
                                    {9, 2, "-7175750.70", 18, 9, "-7175750.700000000", "false"},
                                    {9, 2, "3164314.28", 18, 9, "3164314.280000000", "false"},
                                    {9, 2, "-9999994.33", 18, 9, "-9999994.330000000", "false"},
                                    {9, 2, "-9348816.72", 18, 9, "-9348816.720000000", "false"},
                                    {9, 2, "-1731653.58", 18, 9, "-1731653.580000000", "false"},
                                    {9, 2, "-9838237.67", 18, 9, "-9838237.670000000", "false"},
                                    {9, 2, "2370724.34", 18, 9, "2370724.340000000", "false"},
                                    {9, 2, "-6812112.23", 18, 9, "-6812112.230000000", "false"},
                                    {9, 2, "-9991482.48", 18, 9, "-9991482.480000000", "false"},
                                    {9, 2, "6233222.46", 18, 9, "6233222.460000000", "false"},
                                    {9, 2, "6515458.52", 18, 9, "6515458.520000000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {
            {9, 2, "-5312861.59", 18, 18, "", "true"}, {9, 2, "-8598095.47", 18, 18, "", "true"},
            {9, 2, "-7066651.14", 18, 18, "", "true"}, {9, 2, "-5103450.75", 18, 18, "", "true"},
            {9, 2, "-9604523.36", 18, 18, "", "true"}, {9, 2, "-4119927.29", 18, 18, "", "true"},
            {9, 2, "-6592533.55", 18, 18, "", "true"}, {9, 2, "2418205.13", 18, 18, "", "true"},
            {9, 2, "9261445.50", 18, 18, "", "true"},  {9, 2, "-2566729.01", 18, 18, "", "true"},
            {9, 2, "-9999951.79", 18, 18, "", "true"}, {9, 2, "-9999968.34", 18, 18, "", "true"},
            {9, 2, "2013483.32", 18, 18, "", "true"},  {9, 2, "56058.07", 18, 18, "", "true"},
            {9, 2, "159034.60", 18, 18, "", "true"},   {9, 2, "-6677736.17", 18, 18, "", "true"},
            {9, 2, "-9135763.65", 18, 18, "", "true"}, {9, 2, "6291452.08", 18, 18, "", "true"},
            {9, 2, "-9999999.98", 18, 18, "", "true"}, {9, 2, "-2400207.63", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal64p15s13Abnormal) {
    CastTestCaseArray test_cases = {
            {9, 2, "-8640144.09", 15, 13, "", "true"}, {9, 2, "-4075135.35", 15, 13, "", "true"},
            {9, 2, "-1362479.32", 15, 13, "", "true"}, {9, 2, "-9999964.95", 15, 13, "", "true"},
            {9, 2, "-9999996.75", 15, 13, "", "true"}, {9, 2, "-4853454.41", 15, 13, "", "true"},
            {9, 2, "-6280081.66", 15, 13, "", "true"}, {9, 2, "-7174356.61", 15, 13, "", "true"},
            {9, 2, "1431226.51", 15, 13, "", "true"},  {9, 2, "-3613492.22", 15, 13, "", "true"},
            {9, 2, "-7694579.14", 15, 13, "", "true"}, {9, 2, "1438282.34", 15, 13, "", "true"},
            {9, 2, "6329084.96", 15, 13, "", "true"},  {9, 2, "8717020.05", 15, 13, "", "true"},
            {9, 2, "-9999999.57", 15, 13, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{9, 2, "-392874.33", 15, 13, "-392874.3300000000000", "false"},
                                    {9, 2, "-315936.90", 15, 13, "-315936.9000000000000", "false"},
                                    {9, 2, "0.36", 15, 13, "0.3600000000000", "false"},
                                    {9, 2, "-44535.72", 15, 13, "-44535.7200000000000", "false"},
                                    {9, 2, "-871288.04", 15, 13, "-871288.0400000000000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {
            {9, 2, "-202834.89", 38, 0, "-202835", "false"},   {9, 2, "-9393106.80", 38, 0, "-9393107", "false"},
            {9, 2, "6654.87", 38, 0, "6655", "false"},         {9, 2, "-6766557.61", 38, 0, "-6766558", "false"},
            {9, 2, "-5177230.08", 38, 0, "-5177230", "false"}, {9, 2, "7311415.29", 38, 0, "7311415", "false"},
            {9, 2, "-9700380.61", 38, 0, "-9700381", "false"}, {9, 2, "-1928879.20", 38, 0, "-1928879", "false"},
            {9, 2, "114313.91", 38, 0, "114314", "false"},     {9, 2, "-308170.47", 38, 0, "-308170", "false"},
            {9, 2, "2915618.58", 38, 0, "2915619", "false"},   {9, 2, "-4808979.03", 38, 0, "-4808979", "false"},
            {9, 2, "2521550.24", 38, 0, "2521550", "false"},   {9, 2, "1818248.05", 38, 0, "1818248", "false"},
            {9, 2, "4308171.86", 38, 0, "4308172", "false"},   {9, 2, "150593.37", 38, 0, "150593", "false"},
            {9, 2, "3494057.87", 38, 0, "3494058", "false"},   {9, 2, "-7866097.90", 38, 0, "-7866098", "false"},
            {9, 2, "-8170026.40", 38, 0, "-8170026", "false"}, {9, 2, "-8487738.56", 38, 0, "-8487739", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {{9, 2, "8661246.75", 38, 2, "8661246.75", "false"},
                                    {9, 2, "-9484824.69", 38, 2, "-9484824.69", "false"},
                                    {9, 2, "-7123649.12", 38, 2, "-7123649.12", "false"},
                                    {9, 2, "-9999999.97", 38, 2, "-9999999.97", "false"},
                                    {9, 2, "2300705.80", 38, 2, "2300705.80", "false"},
                                    {9, 2, "-7832827.94", 38, 2, "-7832827.94", "false"},
                                    {9, 2, "0.26", 38, 2, "0.26", "false"},
                                    {9, 2, "-9974080.17", 38, 2, "-9974080.17", "false"},
                                    {9, 2, "-5212889.30", 38, 2, "-5212889.30", "false"},
                                    {9, 2, "5775585.33", 38, 2, "5775585.33", "false"},
                                    {9, 2, "4546323.84", 38, 2, "4546323.84", "false"},
                                    {9, 2, "-1054625.64", 38, 2, "-1054625.64", "false"},
                                    {9, 2, "-5256463.11", 38, 2, "-5256463.11", "false"},
                                    {9, 2, "-2146836.81", 38, 2, "-2146836.81", "false"},
                                    {9, 2, "-3745558.82", 38, 2, "-3745558.82", "false"},
                                    {9, 2, "-1249511.19", 38, 2, "-1249511.19", "false"},
                                    {9, 2, "8633430.61", 38, 2, "8633430.61", "false"},
                                    {9, 2, "-4859626.25", 38, 2, "-4859626.25", "false"},
                                    {9, 2, "1572126.74", 38, 2, "1572126.74", "false"},
                                    {9, 2, "9654854.01", 38, 2, "9654854.01", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {{9, 2, "-8181751.93", 38, 9, "-8181751.930000000", "false"},
                                    {9, 2, "2335112.56", 38, 9, "2335112.560000000", "false"},
                                    {9, 2, "8485064.28", 38, 9, "8485064.280000000", "false"},
                                    {9, 2, "6464496.50", 38, 9, "6464496.500000000", "false"},
                                    {9, 2, "-375536.23", 38, 9, "-375536.230000000", "false"},
                                    {9, 2, "119.34", 38, 9, "119.340000000", "false"},
                                    {9, 2, "0.23", 38, 9, "0.230000000", "false"},
                                    {9, 2, "-9832031.31", 38, 9, "-9832031.310000000", "false"},
                                    {9, 2, "3779005.36", 38, 9, "3779005.360000000", "false"},
                                    {9, 2, "8035759.79", 38, 9, "8035759.790000000", "false"},
                                    {9, 2, "1818248.05", 38, 9, "1818248.050000000", "false"},
                                    {9, 2, "2092772.07", 38, 9, "2092772.070000000", "false"},
                                    {9, 2, "8221994.60", 38, 9, "8221994.600000000", "false"},
                                    {9, 2, "-3723196.64", 38, 9, "-3723196.640000000", "false"},
                                    {9, 2, "-9999999.94", 38, 9, "-9999999.940000000", "false"},
                                    {9, 2, "-9999905.67", 38, 9, "-9999905.670000000", "false"},
                                    {9, 2, "2119139.93", 38, 9, "2119139.930000000", "false"},
                                    {9, 2, "4885587.24", 38, 9, "4885587.240000000", "false"},
                                    {9, 2, "-4643189.26", 38, 9, "-4643189.260000000", "false"},
                                    {9, 2, "531125.10", 38, 9, "531125.100000000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {{9, 2, "3569493.77", 38, 13, "3569493.7700000000000", "false"},
                                    {9, 2, "7864800.86", 38, 13, "7864800.8600000000000", "false"},
                                    {9, 2, "7484440.69", 38, 13, "7484440.6900000000000", "false"},
                                    {9, 2, "-6657967.22", 38, 13, "-6657967.2200000000000", "false"},
                                    {9, 2, "-6489798.42", 38, 13, "-6489798.4200000000000", "false"},
                                    {9, 2, "8592720.23", 38, 13, "8592720.2300000000000", "false"},
                                    {9, 2, "7257668.01", 38, 13, "7257668.0100000000000", "false"},
                                    {9, 2, "-836994.36", 38, 13, "-836994.3600000000000", "false"},
                                    {9, 2, "-9999800.37", 38, 13, "-9999800.3700000000000", "false"},
                                    {9, 2, "-7973173.45", 38, 13, "-7973173.4500000000000", "false"},
                                    {9, 2, "9350960.87", 38, 13, "9350960.8700000000000", "false"},
                                    {9, 2, "7675696.97", 38, 13, "7675696.9700000000000", "false"},
                                    {9, 2, "6327208.64", 38, 13, "6327208.6400000000000", "false"},
                                    {9, 2, "-6910831.78", 38, 13, "-6910831.7800000000000", "false"},
                                    {9, 2, "0.92", 38, 13, "0.9200000000000", "false"},
                                    {9, 2, "-6828536.63", 38, 13, "-6828536.6300000000000", "false"},
                                    {9, 2, "562663.56", 38, 13, "562663.5600000000000", "false"},
                                    {9, 2, "-1068314.28", 38, 13, "-1068314.2800000000000", "false"},
                                    {9, 2, "8035535.92", 38, 13, "8035535.9200000000000", "false"},
                                    {9, 2, "-3068774.58", 38, 13, "-3068774.5800000000000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {{9, 2, "-9999905.10", 38, 18, "-9999905.100000000000000000", "false"},
                                    {9, 2, "-1129643.84", 38, 18, "-1129643.840000000000000000", "false"},
                                    {9, 2, "1342404.13", 38, 18, "1342404.130000000000000000", "false"},
                                    {9, 2, "7496222.49", 38, 18, "7496222.490000000000000000", "false"},
                                    {9, 2, "-9350269.45", 38, 18, "-9350269.450000000000000000", "false"},
                                    {9, 2, "-6093943.47", 38, 18, "-6093943.470000000000000000", "false"},
                                    {9, 2, "7439151.94", 38, 18, "7439151.940000000000000000", "false"},
                                    {9, 2, "4753271.73", 38, 18, "4753271.730000000000000000", "false"},
                                    {9, 2, "-376851.31", 38, 18, "-376851.310000000000000000", "false"},
                                    {9, 2, "-9999997.91", 38, 18, "-9999997.910000000000000000", "false"},
                                    {9, 2, "7222453.58", 38, 18, "7222453.580000000000000000", "false"},
                                    {9, 2, "-5342166.74", 38, 18, "-5342166.740000000000000000", "false"},
                                    {9, 2, "6995536.12", 38, 18, "6995536.120000000000000000", "false"},
                                    {9, 2, "-5738664.94", 38, 18, "-5738664.940000000000000000", "false"},
                                    {9, 2, "6350831.62", 38, 18, "6350831.620000000000000000", "false"},
                                    {9, 2, "1674649.56", 38, 18, "1674649.560000000000000000", "false"},
                                    {9, 2, "7559331.28", 38, 18, "7559331.280000000000000000", "false"},
                                    {9, 2, "5748090.47", 38, 18, "5748090.470000000000000000", "false"},
                                    {9, 2, "-9988006.37", 38, 18, "-9988006.370000000000000000", "false"},
                                    {9, 2, "-8663175.64", 38, 18, "-8663175.640000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s2ToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {{9, 2, "-5332790.92", 35, 30, "-5332790.920000000000000000000000000000", "false"},
                                    {9, 2, "2530861.26", 35, 30, "2530861.260000000000000000000000000000", "false"},
                                    {9, 2, "-7456535.52", 35, 30, "-7456535.520000000000000000000000000000", "false"},
                                    {9, 2, "1818248.05", 35, 30, "1818248.050000000000000000000000000000", "false"},
                                    {9, 2, "-2431645.32", 35, 30, "-2431645.320000000000000000000000000000", "false"},
                                    {9, 2, "-5569458.83", 35, 30, "-5569458.830000000000000000000000000000", "false"},
                                    {9, 2, "5845302.26", 35, 30, "5845302.260000000000000000000000000000", "false"},
                                    {9, 2, "-9420859.59", 35, 30, "-9420859.590000000000000000000000000000", "false"},
                                    {9, 2, "-2023772.23", 35, 30, "-2023772.230000000000000000000000000000", "false"},
                                    {9, 2, "109637.54", 35, 30, "109637.540000000000000000000000000000", "false"},
                                    {9, 2, "1.78", 35, 30, "1.780000000000000000000000000000", "false"},
                                    {9, 2, "8020382.19", 35, 30, "8020382.190000000000000000000000000000", "false"},
                                    {9, 2, "1735948.27", 35, 30, "1735948.270000000000000000000000000000", "false"},
                                    {9, 2, "3611765.29", 35, 30, "3611765.290000000000000000000000000000", "false"},
                                    {9, 2, "6754881.00", 35, 30, "6754881", "false"},
                                    {9, 2, "4888696.57", 35, 30, "4888696.570000000000000000000000000000", "false"},
                                    {9, 2, "4281003.46", 35, 30, "4281003.460000000000000000000000000000", "false"},
                                    {9, 2, "1262339.12", 35, 30, "1262339.120000000000000000000000000000", "false"},
                                    {9, 2, "-9244063.89", 35, 30, "-9244063.890000000000000000000000000000", "false"},
                                    {9, 2, "-1215669.29", 35, 30, "-1215669.290000000000000000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s9ToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {
            {9, 9, "-0.999999233", 9, 0, "-1", "false"}, {9, 9, "-0.152615598", 9, 0, "0", "false"},
            {9, 9, "-0.262300739", 9, 0, "0", "false"},  {9, 9, "-0.999999956", 9, 0, "-1", "false"},
            {9, 9, "0.241801126", 9, 0, "0", "false"},   {9, 9, "0.377841169", 9, 0, "0", "false"},
            {9, 9, "-0.816816536", 9, 0, "-1", "false"}, {9, 9, "-0.611313035", 9, 0, "-1", "false"},
            {9, 9, "0.682486218", 9, 0, "1", "false"},   {9, 9, "0.000009947", 9, 0, "0", "false"},
            {9, 9, "-0.285158396", 9, 0, "0", "false"},  {9, 9, "0.496527035", 9, 0, "0", "false"},
            {9, 9, "0.712718106", 9, 0, "1", "false"},   {9, 9, "-0.958823173", 9, 0, "-1", "false"},
            {9, 9, "-0.861021029", 9, 0, "-1", "false"}, {9, 9, "-0.156741189", 9, 0, "0", "false"},
            {9, 9, "0.120118161", 9, 0, "0", "false"},   {9, 9, "-0.398895535", 9, 0, "0", "false"},
            {9, 9, "0.023139272", 9, 0, "0", "false"},   {9, 9, "0.419229927", 9, 0, "0", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s9ToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {
            {9, 9, "0.310594094", 9, 2, "0.31", "false"},   {9, 9, "0.425129684", 9, 2, "0.43", "false"},
            {9, 9, "-0.921700969", 9, 2, "-0.92", "false"}, {9, 9, "-0.418841524", 9, 2, "-0.42", "false"},
            {9, 9, "0.640217110", 9, 2, "0.64", "false"},   {9, 9, "-0.194494727", 9, 2, "-0.19", "false"},
            {9, 9, "-0.999948325", 9, 2, "-1", "false"},    {9, 9, "0.252794171", 9, 2, "0.25", "false"},
            {9, 9, "-0.267272128", 9, 2, "-0.27", "false"}, {9, 9, "0.270218699", 9, 2, "0.27", "false"},
            {9, 9, "-0.124402633", 9, 2, "-0.12", "false"}, {9, 9, "0.041865511", 9, 2, "0.04", "false"},
            {9, 9, "1.5E-8", 9, 2, "0", "false"},           {9, 9, "0.363794648", 9, 2, "0.36", "false"},
            {9, 9, "-0.999526331", 9, 2, "-1", "false"},    {9, 9, "0.023004742", 9, 2, "0.02", "false"},
            {9, 9, "0.371756949", 9, 2, "0.37", "false"},   {9, 9, "0.851673398", 9, 2, "0.85", "false"},
            {9, 9, "-0.999042558", 9, 2, "-1", "false"},    {9, 9, "-0.721007666", 9, 2, "-0.72", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s9ToDecimal32p9s9Normal) {
    CastTestCaseArray test_cases = {{9, 9, "-0.996456094", 9, 9, "-0.996456094", "false"},
                                    {9, 9, "5.12E-7", 9, 9, "0.000000512", "false"},
                                    {9, 9, "-0.998953941", 9, 9, "-0.998953941", "false"},
                                    {9, 9, "0.516565717", 9, 9, "0.516565717", "false"},
                                    {9, 9, "0.869412072", 9, 9, "0.869412072", "false"},
                                    {9, 9, "-0.217483381", 9, 9, "-0.217483381", "false"},
                                    {9, 9, "0.013424522", 9, 9, "0.013424522", "false"},
                                    {9, 9, "-0.765488922", 9, 9, "-0.765488922", "false"},
                                    {9, 9, "0.635174963", 9, 9, "0.635174963", "false"},
                                    {9, 9, "0.752376751", 9, 9, "0.752376751", "false"},
                                    {9, 9, "-0.936149081", 9, 9, "-0.936149081", "false"},
                                    {9, 9, "-0.024326645", 9, 9, "-0.024326645", "false"},
                                    {9, 9, "0.302758262", 9, 9, "0.302758262", "false"},
                                    {9, 9, "0.993602470", 9, 9, "0.993602470", "false"},
                                    {9, 9, "0.841678721", 9, 9, "0.841678721", "false"},
                                    {9, 9, "0.683405026", 9, 9, "0.683405026", "false"},
                                    {9, 9, "0.290888440", 9, 9, "0.290888440", "false"},
                                    {9, 9, "0.358714478", 9, 9, "0.358714478", "false"},
                                    {9, 9, "4.5E-8", 9, 9, "0.000000045", "false"},
                                    {9, 9, "0.929727335", 9, 9, "0.929727335", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s9ToDecimal32p7s4Normal) {
    CastTestCaseArray test_cases = {{9, 9, "-0.291901436", 7, 4, "-0.2919", "false"},
                                    {9, 9, "-0.999969690", 7, 4, "-1", "false"},
                                    {9, 9, "-0.352904220", 7, 4, "-0.3529", "false"},
                                    {9, 9, "0.742475061", 7, 4, "0.7425", "false"},
                                    {9, 9, "9.7E-8", 7, 4, "0", "false"},
                                    {9, 9, "0.038600020", 7, 4, "0.0386", "false"},
                                    {9, 9, "-0.102360752", 7, 4, "-0.1024", "false"},
                                    {9, 9, "0.869127558", 7, 4, "0.8691", "false"},
                                    {9, 9, "-0.753069083", 7, 4, "-0.7531", "false"},
                                    {9, 9, "0.000001556", 7, 4, "0", "false"},
                                    {9, 9, "0.703895434", 7, 4, "0.7039", "false"},
                                    {9, 9, "0.122973243", 7, 4, "0.1230", "false"},
                                    {9, 9, "-0.767661880", 7, 4, "-0.7677", "false"},
                                    {9, 9, "0.857394752", 7, 4, "0.8574", "false"},
                                    {9, 9, "-0.103031856", 7, 4, "-0.1030", "false"},
                                    {9, 9, "0.774236780", 7, 4, "0.7742", "false"},
                                    {9, 9, "-0.925821202", 7, 4, "-0.9258", "false"},
                                    {9, 9, "0.152326205", 7, 4, "0.1523", "false"},
                                    {9, 9, "0.465321850", 7, 4, "0.4653", "false"},
                                    {9, 9, "0.453854791", 7, 4, "0.4539", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s9ToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {
            {9, 9, "-0.526107888", 18, 0, "-1", "false"}, {9, 9, "0.353046578", 18, 0, "0", "false"},
            {9, 9, "0.493100172", 18, 0, "0", "false"},   {9, 9, "-0.780053376", 18, 0, "-1", "false"},
            {9, 9, "2E-9", 18, 0, "0", "false"},          {9, 9, "0.911807489", 18, 0, "1", "false"},
            {9, 9, "0.872568713", 18, 0, "1", "false"},   {9, 9, "0.000003313", 18, 0, "0", "false"},
            {9, 9, "0.487593662", 18, 0, "0", "false"},   {9, 9, "-0.526448574", 18, 0, "-1", "false"},
            {9, 9, "0.828828482", 18, 0, "1", "false"},   {9, 9, "0.000003076", 18, 0, "0", "false"},
            {9, 9, "-0.981510265", 18, 0, "-1", "false"}, {9, 9, "0.934633525", 18, 0, "1", "false"},
            {9, 9, "-0.487357524", 18, 0, "0", "false"},  {9, 9, "-0.614188093", 18, 0, "-1", "false"},
            {9, 9, "-0.359862875", 18, 0, "0", "false"},  {9, 9, "0.366330219", 18, 0, "0", "false"},
            {9, 9, "-0.515064100", 18, 0, "-1", "false"}, {9, 9, "0.429155384", 18, 0, "0", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s9ToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {
            {9, 9, "0.181824805", 18, 2, "0.18", "false"},   {9, 9, "-0.554801071", 18, 2, "-0.55", "false"},
            {9, 9, "0.724182043", 18, 2, "0.72", "false"},   {9, 9, "-0.821380384", 18, 2, "-0.82", "false"},
            {9, 9, "-0.378527836", 18, 2, "-0.38", "false"}, {9, 9, "0.773125925", 18, 2, "0.77", "false"},
            {9, 9, "0.934876872", 18, 2, "0.93", "false"},   {9, 9, "0.637637682", 18, 2, "0.64", "false"},
            {9, 9, "-0.999903245", 18, 2, "-1", "false"},    {9, 9, "0.606912546", 18, 2, "0.61", "false"},
            {9, 9, "-0.494308564", 18, 2, "-0.49", "false"}, {9, 9, "-0.336911402", 18, 2, "-0.34", "false"},
            {9, 9, "0.665457168", 18, 2, "0.67", "false"},   {9, 9, "-0.117688744", 18, 2, "-0.12", "false"},
            {9, 9, "0.000247980", 18, 2, "0", "false"},      {9, 9, "-0.687460721", 18, 2, "-0.69", "false"},
            {9, 9, "-0.999486883", 18, 2, "-1", "false"},    {9, 9, "0.950234327", 18, 2, "0.95", "false"},
            {9, 9, "0.122561760", 18, 2, "0.12", "false"},   {9, 9, "-0.622409427", 18, 2, "-0.62", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s9ToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {{9, 9, "0.316737542", 18, 9, "0.316737542", "false"},
                                    {9, 9, "0.079249078", 18, 9, "0.079249078", "false"},
                                    {9, 9, "-0.178346086", 18, 9, "-0.178346086", "false"},
                                    {9, 9, "-0.967483016", 18, 9, "-0.967483016", "false"},
                                    {9, 9, "0.142565574", 18, 9, "0.142565574", "false"},
                                    {9, 9, "-0.894757848", 18, 9, "-0.894757848", "false"},
                                    {9, 9, "0.778334377", 18, 9, "0.778334377", "false"},
                                    {9, 9, "0.761644696", 18, 9, "0.761644696", "false"},
                                    {9, 9, "-0.286182163", 18, 9, "-0.286182163", "false"},
                                    {9, 9, "-0.269684962", 18, 9, "-0.269684962", "false"},
                                    {9, 9, "-0.720393244", 18, 9, "-0.720393244", "false"},
                                    {9, 9, "0.034667857", 18, 9, "0.034667857", "false"},
                                    {9, 9, "-0.611605475", 18, 9, "-0.611605475", "false"},
                                    {9, 9, "-0.999999998", 18, 9, "-0.999999998", "false"},
                                    {9, 9, "-0.999999566", 18, 9, "-0.999999566", "false"},
                                    {9, 9, "0.000348295", 18, 9, "0.000348295", "false"},
                                    {9, 9, "-0.238322597", 18, 9, "-0.238322597", "false"},
                                    {9, 9, "0.974689490", 18, 9, "0.974689490", "false"},
                                    {9, 9, "0.000058790", 18, 9, "0.000058790", "false"},
                                    {9, 9, "0.367698752", 18, 9, "0.367698752", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s9ToDecimal64p18s18Normal) {
    CastTestCaseArray test_cases = {{9, 9, "0.040934186", 18, 18, "0.040934186000000000", "false"},
                                    {9, 9, "-0.995121274", 18, 18, "-0.995121274000000000", "false"},
                                    {9, 9, "0.689076581", 18, 18, "0.689076581000000000", "false"},
                                    {9, 9, "3E-9", 18, 18, "0.000000003000000000", "false"},
                                    {9, 9, "0.370084752", 18, 18, "0.370084752000000000", "false"},
                                    {9, 9, "-0.045093071", 18, 18, "-0.045093071000000000", "false"},
                                    {9, 9, "-0.358522831", 18, 18, "-0.358522831000000000", "false"},
                                    {9, 9, "-0.904734763", 18, 18, "-0.904734763000000000", "false"},
                                    {9, 9, "-0.915335804", 18, 18, "-0.915335804000000000", "false"},
                                    {9, 9, "0.530756100", 18, 18, "0.530756100000000000", "false"},
                                    {9, 9, "0.225573676", 18, 18, "0.225573676000000000", "false"},
                                    {9, 9, "0.558410360", 18, 18, "0.558410360000000000", "false"},
                                    {9, 9, "0.208757057", 18, 18, "0.208757057000000000", "false"},
                                    {9, 9, "0.350368710", 18, 18, "0.350368710000000000", "false"},
                                    {9, 9, "-0.999996933", 18, 18, "-0.999996933000000000", "false"},
                                    {9, 9, "0.816389977", 18, 18, "0.816389977000000000", "false"},
                                    {9, 9, "0.851531250", 18, 18, "0.851531250000000000", "false"},
                                    {9, 9, "0.602129022", 18, 18, "0.602129022000000000", "false"},
                                    {9, 9, "-0.353662692", 18, 18, "-0.353662692000000000", "false"},
                                    {9, 9, "0.000001834", 18, 18, "0.000001834000000000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s9ToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{9, 9, "-0.285700806", 15, 13, "-0.2857008060000", "false"},
                                    {9, 9, "-0.695609885", 15, 13, "-0.6956098850000", "false"},
                                    {9, 9, "0.117069889", 15, 13, "0.1170698890000", "false"},
                                    {9, 9, "-0.999999724", 15, 13, "-0.9999997240000", "false"},
                                    {9, 9, "-0.037203320", 15, 13, "-0.0372033200000", "false"},
                                    {9, 9, "0.592134271", 15, 13, "0.5921342710000", "false"},
                                    {9, 9, "0.814560066", 15, 13, "0.8145600660000", "false"},
                                    {9, 9, "-0.322631622", 15, 13, "-0.3226316220000", "false"},
                                    {9, 9, "-0.999999165", 15, 13, "-0.9999991650000", "false"},
                                    {9, 9, "-0.413166204", 15, 13, "-0.4131662040000", "false"},
                                    {9, 9, "-0.424489157", 15, 13, "-0.4244891570000", "false"},
                                    {9, 9, "0.000434951", 15, 13, "0.0004349510000", "false"},
                                    {9, 9, "-0.087697262", 15, 13, "-0.0876972620000", "false"},
                                    {9, 9, "-0.037645622", 15, 13, "-0.0376456220000", "false"},
                                    {9, 9, "-0.477248223", 15, 13, "-0.4772482230000", "false"},
                                    {9, 9, "0.001413170", 15, 13, "0.0014131700000", "false"},
                                    {9, 9, "0.514104973", 15, 13, "0.5141049730000", "false"},
                                    {9, 9, "9.14E-7", 15, 13, "0.0000009140000", "false"},
                                    {9, 9, "0.547400054", 15, 13, "0.5474000540000", "false"},
                                    {9, 9, "-0.049950118", 15, 13, "-0.0499501180000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s9ToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {
            {9, 9, "0.056781238", 38, 0, "0", "false"},   {9, 9, "-0.386632869", 38, 0, "0", "false"},
            {9, 9, "0.195956976", 38, 0, "0", "false"},   {9, 9, "-0.999726806", 38, 0, "-1", "false"},
            {9, 9, "-0.320439217", 38, 0, "0", "false"},  {9, 9, "-0.087760242", 38, 0, "0", "false"},
            {9, 9, "-0.999996786", 38, 0, "-1", "false"}, {9, 9, "-0.977201240", 38, 0, "-1", "false"},
            {9, 9, "-0.103563040", 38, 0, "0", "false"},  {9, 9, "-0.667781014", 38, 0, "-1", "false"},
            {9, 9, "-0.751725244", 38, 0, "-1", "false"}, {9, 9, "0.114091327", 38, 0, "0", "false"},
            {9, 9, "0.000001982", 38, 0, "0", "false"},   {9, 9, "-0.479071155", 38, 0, "0", "false"},
            {9, 9, "-0.621378030", 38, 0, "-1", "false"}, {9, 9, "0.110852460", 38, 0, "0", "false"},
            {9, 9, "-0.511738968", 38, 0, "-1", "false"}, {9, 9, "-0.230715362", 38, 0, "0", "false"},
            {9, 9, "0.248874361", 38, 0, "0", "false"},   {9, 9, "0.988855095", 38, 0, "1", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s9ToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {
            {9, 9, "-0.620074710", 38, 2, "-0.62", "false"}, {9, 9, "-0.999998250", 38, 2, "-1", "false"},
            {9, 9, "-0.541084491", 38, 2, "-0.54", "false"}, {9, 9, "0.445007002", 38, 2, "0.45", "false"},
            {9, 9, "0.957661365", 38, 2, "0.96", "false"},   {9, 9, "0.181824805", 38, 2, "0.18", "false"},
            {9, 9, "-0.964678223", 38, 2, "-0.96", "false"}, {9, 9, "0.552897924", 38, 2, "0.55", "false"},
            {9, 9, "0.350707637", 38, 2, "0.35", "false"},   {9, 9, "0.427282663", 38, 2, "0.43", "false"},
            {9, 9, "0.271432768", 38, 2, "0.27", "false"},   {9, 9, "-0.941739438", 38, 2, "-0.94", "false"},
            {9, 9, "0.025011863", 38, 2, "0.03", "false"},   {9, 9, "-0.625221139", 38, 2, "-0.63", "false"},
            {9, 9, "0.981889047", 38, 2, "0.98", "false"},   {9, 9, "-0.788027317", 38, 2, "-0.79", "false"},
            {9, 9, "-0.860260839", 38, 2, "-0.86", "false"}, {9, 9, "-0.968478943", 38, 2, "-0.97", "false"},
            {9, 9, "0.812940523", 38, 2, "0.81", "false"},   {9, 9, "0.970505153", 38, 2, "0.97", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s9ToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {{9, 9, "0.001617869", 38, 9, "0.001617869", "false"},
                                    {9, 9, "-0.999997287", 38, 9, "-0.999997287", "false"},
                                    {9, 9, "0.545838131", 38, 9, "0.545838131", "false"},
                                    {9, 9, "-0.999993875", 38, 9, "-0.999993875", "false"},
                                    {9, 9, "-0.999618234", 38, 9, "-0.999618234", "false"},
                                    {9, 9, "0.271740701", 38, 9, "0.271740701", "false"},
                                    {9, 9, "-0.726249809", 38, 9, "-0.726249809", "false"},
                                    {9, 9, "-0.707199505", 38, 9, "-0.707199505", "false"},
                                    {9, 9, "6E-9", 38, 9, "0.000000006", "false"},
                                    {9, 9, "0.135757311", 38, 9, "0.135757311", "false"},
                                    {9, 9, "-0.489245970", 38, 9, "-0.489245970", "false"},
                                    {9, 9, "0.222069613", 38, 9, "0.222069613", "false"},
                                    {9, 9, "0.140231711", 38, 9, "0.140231711", "false"},
                                    {9, 9, "-0.095999796", 38, 9, "-0.095999796", "false"},
                                    {9, 9, "-0.273470742", 38, 9, "-0.273470742", "false"},
                                    {9, 9, "-0.999988807", 38, 9, "-0.999988807", "false"},
                                    {9, 9, "0.045596443", 38, 9, "0.045596443", "false"},
                                    {9, 9, "0.000165001", 38, 9, "0.000165001", "false"},
                                    {9, 9, "0.683111000", 38, 9, "0.683111000", "false"},
                                    {9, 9, "-0.699536305", 38, 9, "-0.699536305", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s9ToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {{9, 9, "0.588331267", 38, 13, "0.5883312670000", "false"},
                                    {9, 9, "-0.567477064", 38, 13, "-0.5674770640000", "false"},
                                    {9, 9, "-0.759397111", 38, 13, "-0.7593971110000", "false"},
                                    {9, 9, "-0.483356867", 38, 13, "-0.4833568670000", "false"},
                                    {9, 9, "-0.732904729", 38, 13, "-0.7329047290000", "false"},
                                    {9, 9, "-0.906697877", 38, 13, "-0.9066978770000", "false"},
                                    {9, 9, "0.071337657", 38, 13, "0.0713376570000", "false"},
                                    {9, 9, "-0.503572942", 38, 13, "-0.5035729420000", "false"},
                                    {9, 9, "-0.510204207", 38, 13, "-0.5102042070000", "false"},
                                    {9, 9, "-0.115557436", 38, 13, "-0.1155574360000", "false"},
                                    {9, 9, "0.757379138", 38, 13, "0.7573791380000", "false"},
                                    {9, 9, "-0.628975615", 38, 13, "-0.6289756150000", "false"},
                                    {9, 9, "-0.999949313", 38, 13, "-0.9999493130000", "false"},
                                    {9, 9, "-0.136651608", 38, 13, "-0.1366516080000", "false"},
                                    {9, 9, "0.003897673", 38, 13, "0.0038976730000", "false"},
                                    {9, 9, "0.000137705", 38, 13, "0.0001377050000", "false"},
                                    {9, 9, "-0.121447686", 38, 13, "-0.1214476860000", "false"},
                                    {9, 9, "0.822296612", 38, 13, "0.8222966120000", "false"},
                                    {9, 9, "-0.745916059", 38, 13, "-0.7459160590000", "false"},
                                    {9, 9, "0.522206715", 38, 13, "0.5222067150000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s9ToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {{9, 9, "0.047848978", 38, 18, "0.047848978000000000", "false"},
                                    {9, 9, "0.274745655", 38, 18, "0.274745655000000000", "false"},
                                    {9, 9, "-0.729200674", 38, 18, "-0.729200674000000000", "false"},
                                    {9, 9, "0.502447959", 38, 18, "0.502447959000000000", "false"},
                                    {9, 9, "0.762965671", 38, 18, "0.762965671000000000", "false"},
                                    {9, 9, "-0.196909457", 38, 18, "-0.196909457000000000", "false"},
                                    {9, 9, "-0.332095041", 38, 18, "-0.332095041000000000", "false"},
                                    {9, 9, "6E-9", 38, 18, "0.000000006000000000", "false"},
                                    {9, 9, "-0.918720651", 38, 18, "-0.918720651000000000", "false"},
                                    {9, 9, "-0.184042266", 38, 18, "-0.184042266000000000", "false"},
                                    {9, 9, "5E-9", 38, 18, "0.000000005000000000", "false"},
                                    {9, 9, "-0.561717365", 38, 18, "-0.561717365000000000", "false"},
                                    {9, 9, "0.150923766", 38, 18, "0.150923766000000000", "false"},
                                    {9, 9, "0.554365729", 38, 18, "0.554365729000000000", "false"},
                                    {9, 9, "-0.999114562", 38, 18, "-0.999114562000000000", "false"},
                                    {9, 9, "-0.466612574", 38, 18, "-0.466612574000000000", "false"},
                                    {9, 9, "0.897101588", 38, 18, "0.897101588000000000", "false"},
                                    {9, 9, "-0.999999536", 38, 18, "-0.999999536000000000", "false"},
                                    {9, 9, "-0.838239345", 38, 18, "-0.838239345000000000", "false"},
                                    {9, 9, "0.637490749", 38, 18, "0.637490749000000000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p9s9ToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {{9, 9, "0.615756977", 35, 30, "0.615756977000000000000000000000", "false"},
                                    {9, 9, "-0.278755324", 35, 30, "-0.278755324000000000000000000000", "false"},
                                    {9, 9, "-0.444434327", 35, 30, "-0.444434327000000000000000000000", "false"},
                                    {9, 9, "-0.984597823", 35, 30, "-0.984597823000000000000000000000", "false"},
                                    {9, 9, "2.28E-7", 35, 30, "0.000000228000000000000000000000", "false"},
                                    {9, 9, "0.000001279", 35, 30, "0.000001279000000000000000000000", "false"},
                                    {9, 9, "0.111626588", 35, 30, "0.111626588000000000000000000000", "false"},
                                    {9, 9, "0.328478852", 35, 30, "0.328478852000000000000000000000", "false"},
                                    {9, 9, "-0.554372008", 35, 30, "-0.554372008000000000000000000000", "false"},
                                    {9, 9, "0.028130667", 35, 30, "0.028130667000000000000000000000", "false"},
                                    {9, 9, "-0.204362205", 35, 30, "-0.204362205000000000000000000000", "false"},
                                    {9, 9, "0.881425057", 35, 30, "0.881425057000000000000000000000", "false"},
                                    {9, 9, "-0.956100523", 35, 30, "-0.956100523000000000000000000000", "false"},
                                    {9, 9, "0.000004563", 35, 30, "0.000004563000000000000000000000", "false"},
                                    {9, 9, "-0.387107866", 35, 30, "-0.387107866000000000000000000000", "false"},
                                    {9, 9, "-0.387975712", 35, 30, "-0.387975712000000000000000000000", "false"},
                                    {9, 9, "0.627852561", 35, 30, "0.627852561000000000000000000000", "false"},
                                    {9, 9, "-0.723034619", 35, 30, "-0.723034619000000000000000000000", "false"},
                                    {9, 9, "-0.461450267", 35, 30, "-0.461450267000000000000000000000", "false"},
                                    {9, 9, "-0.377187877", 35, 30, "-0.377187877000000000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {
            {7, 4, "-891.6203", 9, 0, "-892", "false"}, {7, 4, "464.0518", 9, 0, "464", "false"},
            {7, 4, "76.3531", 9, 0, "76", "false"},     {7, 4, "386.8184", 9, 0, "387", "false"},
            {7, 4, "-989.5054", 9, 0, "-990", "false"}, {7, 4, "384.0163", 9, 0, "384", "false"},
            {7, 4, "182.0439", 9, 0, "182", "false"},   {7, 4, "-213.1336", 9, 0, "-213", "false"},
            {7, 4, "240.2376", 9, 0, "240", "false"},   {7, 4, "721.9971", 9, 0, "722", "false"},
            {7, 4, "0.0166", 9, 0, "0", "false"},       {7, 4, "-23.1368", 9, 0, "-23", "false"},
            {7, 4, "-96.8659", 9, 0, "-97", "false"},   {7, 4, "-172.2644", 9, 0, "-172", "false"},
            {7, 4, "0.0124", 9, 0, "0", "false"},       {7, 4, "823.9971", 9, 0, "824", "false"},
            {7, 4, "970.1293", 9, 0, "970", "false"},   {7, 4, "-608.0764", 9, 0, "-608", "false"},
            {7, 4, "-822.9238", 9, 0, "-823", "false"}, {7, 4, "-643.2254", 9, 0, "-643", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {
            {7, 4, "304.3415", 9, 2, "304.34", "false"},   {7, 4, "0.0860", 9, 2, "0.09", "false"},
            {7, 4, "878.7771", 9, 2, "878.78", "false"},   {7, 4, "-794.0903", 9, 2, "-794.09", "false"},
            {7, 4, "-773.5949", 9, 2, "-773.59", "false"}, {7, 4, "-332.2768", 9, 2, "-332.28", "false"},
            {7, 4, "11.6562", 9, 2, "11.66", "false"},     {7, 4, "0.0081", 9, 2, "0.01", "false"},
            {7, 4, "-582.3536", 9, 2, "-582.35", "false"}, {7, 4, "973.0850", 9, 2, "973.09", "false"},
            {7, 4, "7.2054", 9, 2, "7.21", "false"},       {7, 4, "-999.8771", 9, 2, "-999.88", "false"},
            {7, 4, "916.7237", 9, 2, "916.72", "false"},   {7, 4, "-370.4714", 9, 2, "-370.47", "false"},
            {7, 4, "51.6824", 9, 2, "51.68", "false"},     {7, 4, "-247.2531", 9, 2, "-247.25", "false"},
            {7, 4, "106.3562", 9, 2, "106.36", "false"},   {7, 4, "80.6821", 9, 2, "80.68", "false"},
            {7, 4, "-881.2133", 9, 2, "-881.21", "false"}, {7, 4, "0.0001", 9, 2, "0", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {{7, 4, "798.4100", 9, 9, "", "true"},  {7, 4, "232.2193", 9, 9, "", "true"},
                                    {7, 4, "-95.3640", 9, 9, "", "true"},  {7, 4, "120.0108", 9, 9, "", "true"},
                                    {7, 4, "-103.9896", 9, 9, "", "true"}, {7, 4, "685.6318", 9, 9, "", "true"},
                                    {7, 4, "411.4937", 9, 9, "", "true"},  {7, 4, "-52.4942", 9, 9, "", "true"},
                                    {7, 4, "755.5238", 9, 9, "", "true"},  {7, 4, "2.9549", 9, 9, "", "true"},
                                    {7, 4, "-742.1091", 9, 9, "", "true"}, {7, 4, "842.6576", 9, 9, "", "true"},
                                    {7, 4, "-989.1442", 9, 9, "", "true"}, {7, 4, "-92.8470", 9, 9, "", "true"},
                                    {7, 4, "190.2455", 9, 9, "", "true"},  {7, 4, "-613.5263", 9, 9, "", "true"},
                                    {7, 4, "435.0865", 9, 9, "", "true"},  {7, 4, "-574.1793", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal32p9s9Normal) {
    CastTestCaseArray test_cases = {{7, 4, "1.2924", 9, 9, "1.292400000", "false"},
                                    {7, 4, "0.0417", 9, 9, "0.041700000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal32p7s4Normal) {
    CastTestCaseArray test_cases = {
            {7, 4, "0.0003", 7, 4, "0.0003", "false"},       {7, 4, "-738.3838", 7, 4, "-738.3838", "false"},
            {7, 4, "-168.0346", 7, 4, "-168.0346", "false"}, {7, 4, "189.6431", 7, 4, "189.6431", "false"},
            {7, 4, "756.1485", 7, 4, "756.1485", "false"},   {7, 4, "617.2317", 7, 4, "617.2317", "false"},
            {7, 4, "-628.6804", 7, 4, "-628.6804", "false"}, {7, 4, "941.2119", 7, 4, "941.2119", "false"},
            {7, 4, "787.9132", 7, 4, "787.9132", "false"},   {7, 4, "-54.6851", 7, 4, "-54.6851", "false"},
            {7, 4, "352.4766", 7, 4, "352.4766", "false"},   {7, 4, "938.1765", 7, 4, "938.1765", "false"},
            {7, 4, "0.0001", 7, 4, "0.0001", "false"},       {7, 4, "565.8781", 7, 4, "565.8781", "false"},
            {7, 4, "231.9448", 7, 4, "231.9448", "false"},   {7, 4, "-347.2992", 7, 4, "-347.2992", "false"},
            {7, 4, "120.4852", 7, 4, "120.4852", "false"},   {7, 4, "-299.8869", 7, 4, "-299.8869", "false"},
            {7, 4, "941.8299", 7, 4, "941.8299", "false"},   {7, 4, "121.7603", 7, 4, "121.7603", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {
            {7, 4, "-907.3273", 18, 0, "-907", "false"}, {7, 4, "0.6836", 18, 0, "1", "false"},
            {7, 4, "-481.9521", 18, 0, "-482", "false"}, {7, 4, "-305.1582", 18, 0, "-305", "false"},
            {7, 4, "1.6394", 18, 0, "2", "false"},       {7, 4, "-999.7124", 18, 0, "-1000", "false"},
            {7, 4, "785.4296", 18, 0, "785", "false"},   {7, 4, "-960.3141", 18, 0, "-960", "false"},
            {7, 4, "-798.9540", 18, 0, "-799", "false"}, {7, 4, "-999.9988", 18, 0, "-1000", "false"},
            {7, 4, "-455.0892", 18, 0, "-455", "false"}, {7, 4, "150.8027", 18, 0, "151", "false"},
            {7, 4, "246.9674", 18, 0, "247", "false"},   {7, 4, "502.7787", 18, 0, "503", "false"},
            {7, 4, "-80.9681", 18, 0, "-81", "false"},   {7, 4, "-836.3820", 18, 0, "-836", "false"},
            {7, 4, "-571.4782", 18, 0, "-571", "false"}, {7, 4, "765.8286", 18, 0, "766", "false"},
            {7, 4, "-701.5520", 18, 0, "-702", "false"}, {7, 4, "-943.8315", 18, 0, "-944", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {
            {7, 4, "365.5301", 18, 2, "365.53", "false"},   {7, 4, "-715.1415", 18, 2, "-715.14", "false"},
            {7, 4, "-449.3350", 18, 2, "-449.34", "false"}, {7, 4, "70.4582", 18, 2, "70.46", "false"},
            {7, 4, "824.2894", 18, 2, "824.29", "false"},   {7, 4, "-22.0092", 18, 2, "-22.01", "false"},
            {7, 4, "625.9041", 18, 2, "625.90", "false"},   {7, 4, "-764.9599", 18, 2, "-764.96", "false"},
            {7, 4, "629.1022", 18, 2, "629.10", "false"},   {7, 4, "-305.4268", 18, 2, "-305.43", "false"},
            {7, 4, "307.5004", 18, 2, "307.50", "false"},   {7, 4, "915.8323", 18, 2, "915.83", "false"},
            {7, 4, "-646.4232", 18, 2, "-646.42", "false"}, {7, 4, "-657.0198", 18, 2, "-657.02", "false"},
            {7, 4, "-999.9580", 18, 2, "-999.96", "false"}, {7, 4, "0.0653", 18, 2, "0.07", "false"},
            {7, 4, "-289.7361", 18, 2, "-289.74", "false"}, {7, 4, "792.5456", 18, 2, "792.55", "false"},
            {7, 4, "-969.1461", 18, 2, "-969.15", "false"}, {7, 4, "425.2416", 18, 2, "425.24", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {{7, 4, "-312.1227", 18, 9, "-312.122700000", "false"},
                                    {7, 4, "-38.9261", 18, 9, "-38.926100000", "false"},
                                    {7, 4, "-622.8221", 18, 9, "-622.822100000", "false"},
                                    {7, 4, "714.2583", 18, 9, "714.258300000", "false"},
                                    {7, 4, "617.6514", 18, 9, "617.651400000", "false"},
                                    {7, 4, "1.8130", 18, 9, "1.813000000", "false"},
                                    {7, 4, "133.7133", 18, 9, "133.713300000", "false"},
                                    {7, 4, "882.1411", 18, 9, "882.141100000", "false"},
                                    {7, 4, "-921.7221", 18, 9, "-921.722100000", "false"},
                                    {7, 4, "-999.9776", 18, 9, "-999.977600000", "false"},
                                    {7, 4, "413.7347", 18, 9, "413.734700000", "false"},
                                    {7, 4, "-996.2239", 18, 9, "-996.223900000", "false"},
                                    {7, 4, "593.3034", 18, 9, "593.303400000", "false"},
                                    {7, 4, "901.1827", 18, 9, "901.182700000", "false"},
                                    {7, 4, "0.0480", 18, 9, "0.048000000", "false"},
                                    {7, 4, "-361.8533", 18, 9, "-361.853300000", "false"},
                                    {7, 4, "-95.8657", 18, 9, "-95.865700000", "false"},
                                    {7, 4, "-93.0537", 18, 9, "-93.053700000", "false"},
                                    {7, 4, "32.0127", 18, 9, "32.012700000", "false"},
                                    {7, 4, "1.9498", 18, 9, "1.949800000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {{7, 4, "412.0230", 18, 18, "", "true"},  {7, 4, "-68.0210", 18, 18, "", "true"},
                                    {7, 4, "522.1365", 18, 18, "", "true"},  {7, 4, "-19.6232", 18, 18, "", "true"},
                                    {7, 4, "528.6167", 18, 18, "", "true"},  {7, 4, "734.9973", 18, 18, "", "true"},
                                    {7, 4, "-895.7784", 18, 18, "", "true"}, {7, 4, "631.9367", 18, 18, "", "true"},
                                    {7, 4, "28.4188", 18, 18, "", "true"},   {7, 4, "-999.9998", 18, 18, "", "true"},
                                    {7, 4, "-597.9291", 18, 18, "", "true"}, {7, 4, "-378.6295", 18, 18, "", "true"},
                                    {7, 4, "263.8225", 18, 18, "", "true"},  {7, 4, "560.6658", 18, 18, "", "true"},
                                    {7, 4, "733.5909", 18, 18, "", "true"},  {7, 4, "315.4069", 18, 18, "", "true"},
                                    {7, 4, "-999.9928", 18, 18, "", "true"}, {7, 4, "-780.2254", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal64p18s18Normal) {
    CastTestCaseArray test_cases = {{7, 4, "0.0024", 18, 18, "0.002400000000000000", "false"},
                                    {7, 4, "-8.6909", 18, 18, "-8.690900000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{7, 4, "-998.9859", 15, 13, "-998.9859000000000", "false"},
                                    {7, 4, "-612.5482", 15, 13, "-612.5482000000000", "false"},
                                    {7, 4, "-912.4642", 15, 13, "-912.4642000000000", "false"},
                                    {7, 4, "541.8793", 15, 13, "541.8793000000000", "false"},
                                    {7, 4, "830.6986", 15, 13, "830.6986000000000", "false"},
                                    {7, 4, "328.1907", 15, 13, "328.1907000000000", "false"},
                                    {7, 4, "111.8540", 15, 13, "111.8540000000000", "false"},
                                    {7, 4, "-842.7108", 15, 13, "-842.7108000000000", "false"},
                                    {7, 4, "73.1051", 15, 13, "73.1051000000000", "false"},
                                    {7, 4, "721.2577", 15, 13, "721.2577000000000", "false"},
                                    {7, 4, "927.8282", 15, 13, "927.8282000000000", "false"},
                                    {7, 4, "490.5666", 15, 13, "490.5666000000000", "false"},
                                    {7, 4, "-633.0681", 15, 13, "-633.0681000000000", "false"},
                                    {7, 4, "251.5243", 15, 13, "251.5243000000000", "false"},
                                    {7, 4, "0.0143", 15, 13, "0.0143000000000", "false"},
                                    {7, 4, "-713.3144", 15, 13, "-713.3144000000000", "false"},
                                    {7, 4, "845.0474", 15, 13, "845.0474000000000", "false"},
                                    {7, 4, "-863.0587", 15, 13, "-863.0587000000000", "false"},
                                    {7, 4, "-904.1870", 15, 13, "-904.1870000000000", "false"},
                                    {7, 4, "-175.5768", 15, 13, "-175.5768000000000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {
            {7, 4, "-39.5805", 38, 0, "-40", "false"},   {7, 4, "-907.3669", 38, 0, "-907", "false"},
            {7, 4, "-602.5386", 38, 0, "-603", "false"}, {7, 4, "0.0030", 38, 0, "0", "false"},
            {7, 4, "-232.5741", 38, 0, "-233", "false"}, {7, 4, "-625.8250", 38, 0, "-626", "false"},
            {7, 4, "-671.3228", 38, 0, "-671", "false"}, {7, 4, "932.0057", 38, 0, "932", "false"},
            {7, 4, "375.2315", 38, 0, "375", "false"},   {7, 4, "842.3054", 38, 0, "842", "false"},
            {7, 4, "719.0993", 38, 0, "719", "false"},   {7, 4, "-737.9450", 38, 0, "-738", "false"},
            {7, 4, "-268.4750", 38, 0, "-268", "false"}, {7, 4, "776.2839", 38, 0, "776", "false"},
            {7, 4, "-862.9046", 38, 0, "-863", "false"}, {7, 4, "284.0478", 38, 0, "284", "false"},
            {7, 4, "-528.7247", 38, 0, "-529", "false"}, {7, 4, "32.0664", 38, 0, "32", "false"},
            {7, 4, "-658.0026", 38, 0, "-658", "false"}, {7, 4, "-626.7289", 38, 0, "-627", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {
            {7, 4, "-549.1730", 38, 2, "-549.17", "false"}, {7, 4, "622.7187", 38, 2, "622.72", "false"},
            {7, 4, "-79.8666", 38, 2, "-79.87", "false"},   {7, 4, "0.0152", 38, 2, "0.02", "false"},
            {7, 4, "-999.9950", 38, 2, "-1000", "false"},   {7, 4, "-310.3476", 38, 2, "-310.35", "false"},
            {7, 4, "-871.3261", 38, 2, "-871.33", "false"}, {7, 4, "36.8203", 38, 2, "36.82", "false"},
            {7, 4, "-188.3038", 38, 2, "-188.30", "false"}, {7, 4, "381.3726", 38, 2, "381.37", "false"},
            {7, 4, "227.5801", 38, 2, "227.58", "false"},   {7, 4, "100.6178", 38, 2, "100.62", "false"},
            {7, 4, "-998.6543", 38, 2, "-998.65", "false"}, {7, 4, "-999.9670", 38, 2, "-999.97", "false"},
            {7, 4, "-81.5093", 38, 2, "-81.51", "false"},   {7, 4, "-394.4204", 38, 2, "-394.42", "false"},
            {7, 4, "-988.1021", 38, 2, "-988.10", "false"}, {7, 4, "-526.3855", 38, 2, "-526.39", "false"},
            {7, 4, "-179.8200", 38, 2, "-179.82", "false"}, {7, 4, "-738.5825", 38, 2, "-738.58", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {{7, 4, "381.7695", 38, 9, "381.769500000", "false"},
                                    {7, 4, "743.5731", 38, 9, "743.573100000", "false"},
                                    {7, 4, "900.2673", 38, 9, "900.267300000", "false"},
                                    {7, 4, "393.5802", 38, 9, "393.580200000", "false"},
                                    {7, 4, "639.2711", 38, 9, "639.271100000", "false"},
                                    {7, 4, "-874.3600", 38, 9, "-874.360000000", "false"},
                                    {7, 4, "970.6589", 38, 9, "970.658900000", "false"},
                                    {7, 4, "31.9121", 38, 9, "31.912100000", "false"},
                                    {7, 4, "269.8747", 38, 9, "269.874700000", "false"},
                                    {7, 4, "314.1413", 38, 9, "314.141300000", "false"},
                                    {7, 4, "788.5853", 38, 9, "788.585300000", "false"},
                                    {7, 4, "-194.1044", 38, 9, "-194.104400000", "false"},
                                    {7, 4, "-757.8532", 38, 9, "-757.853200000", "false"},
                                    {7, 4, "486.9989", 38, 9, "486.998900000", "false"},
                                    {7, 4, "0.0085", 38, 9, "0.008500000", "false"},
                                    {7, 4, "-314.3324", 38, 9, "-314.332400000", "false"},
                                    {7, 4, "455.6445", 38, 9, "455.644500000", "false"},
                                    {7, 4, "-997.9391", 38, 9, "-997.939100000", "false"},
                                    {7, 4, "722.9617", 38, 9, "722.961700000", "false"},
                                    {7, 4, "-526.7632", 38, 9, "-526.763200000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {{7, 4, "-774.3404", 38, 13, "-774.3404000000000", "false"},
                                    {7, 4, "969.7554", 38, 13, "969.7554000000000", "false"},
                                    {7, 4, "8.7221", 38, 13, "8.7221000000000", "false"},
                                    {7, 4, "-912.6927", 38, 13, "-912.6927000000000", "false"},
                                    {7, 4, "46.3239", 38, 13, "46.3239000000000", "false"},
                                    {7, 4, "68.5466", 38, 13, "68.5466000000000", "false"},
                                    {7, 4, "22.9594", 38, 13, "22.9594000000000", "false"},
                                    {7, 4, "607.6541", 38, 13, "607.6541000000000", "false"},
                                    {7, 4, "-299.2227", 38, 13, "-299.2227000000000", "false"},
                                    {7, 4, "-999.9986", 38, 13, "-999.9986000000000", "false"},
                                    {7, 4, "-384.8997", 38, 13, "-384.8997000000000", "false"},
                                    {7, 4, "6.2038", 38, 13, "6.2038000000000", "false"},
                                    {7, 4, "-206.5154", 38, 13, "-206.5154000000000", "false"},
                                    {7, 4, "-96.4778", 38, 13, "-96.4778000000000", "false"},
                                    {7, 4, "921.9674", 38, 13, "921.9674000000000", "false"},
                                    {7, 4, "382.6744", 38, 13, "382.6744000000000", "false"},
                                    {7, 4, "754.3852", 38, 13, "754.3852000000000", "false"},
                                    {7, 4, "266.7565", 38, 13, "266.7565000000000", "false"},
                                    {7, 4, "386.1022", 38, 13, "386.1022000000000", "false"},
                                    {7, 4, "-790.3836", 38, 13, "-790.3836000000000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {{7, 4, "515.2307", 38, 18, "515.230700000000000000", "false"},
                                    {7, 4, "-844.4765", 38, 18, "-844.476500000000000000", "false"},
                                    {7, 4, "-999.9780", 38, 18, "-999.978000000000000000", "false"},
                                    {7, 4, "609.7363", 38, 18, "609.736300000000000000", "false"},
                                    {7, 4, "580.3069", 38, 18, "580.306900000000000000", "false"},
                                    {7, 4, "329.0641", 38, 18, "329.064100000000000000", "false"},
                                    {7, 4, "0.0000", 38, 18, "0", "false"},
                                    {7, 4, "-130.0352", 38, 18, "-130.035200000000000000", "false"},
                                    {7, 4, "26.2042", 38, 18, "26.204200000000000000", "false"},
                                    {7, 4, "747.7433", 38, 18, "747.743300000000000000", "false"},
                                    {7, 4, "-999.9998", 38, 18, "-999.999800000000000000", "false"},
                                    {7, 4, "-647.4535", 38, 18, "-647.453500000000000000", "false"},
                                    {7, 4, "-884.9913", 38, 18, "-884.991300000000000000", "false"},
                                    {7, 4, "519.4156", 38, 18, "519.415600000000000000", "false"},
                                    {7, 4, "-950.6359", 38, 18, "-950.635900000000000000", "false"},
                                    {7, 4, "-236.9672", 38, 18, "-236.967200000000000000", "false"},
                                    {7, 4, "-999.6164", 38, 18, "-999.616400000000000000", "false"},
                                    {7, 4, "-466.1341", 38, 18, "-466.134100000000000000", "false"},
                                    {7, 4, "841.1945", 38, 18, "841.194500000000000000", "false"},
                                    {7, 4, "0.0059", 38, 18, "0.005900000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal32p7s4ToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {{7, 4, "-800.2625", 35, 30, "-800.262500000000000000000000000000", "false"},
                                    {7, 4, "233.7290", 35, 30, "233.729000000000000000000000000000", "false"},
                                    {7, 4, "753.7287", 35, 30, "753.728700000000000000000000000000", "false"},
                                    {7, 4, "-386.6349", 35, 30, "-386.634900000000000000000000000000", "false"},
                                    {7, 4, "-719.5214", 35, 30, "-719.521400000000000000000000000000", "false"},
                                    {7, 4, "-995.2564", 35, 30, "-995.256400000000000000000000000000", "false"},
                                    {7, 4, "170.3167", 35, 30, "170.316700000000000000000000000000", "false"},
                                    {7, 4, "167.5115", 35, 30, "167.511500000000000000000000000000", "false"},
                                    {7, 4, "-707.5531", 35, 30, "-707.553100000000000000000000000000", "false"},
                                    {7, 4, "814.6026", 35, 30, "814.602600000000000000000000000000", "false"},
                                    {7, 4, "-960.0119", 35, 30, "-960.011900000000000000000000000000", "false"},
                                    {7, 4, "-664.8780", 35, 30, "-664.878000000000000000000000000000", "false"},
                                    {7, 4, "926.8666", 35, 30, "926.866600000000000000000000000000", "false"},
                                    {7, 4, "-981.3690", 35, 30, "-981.369000000000000000000000000000", "false"},
                                    {7, 4, "638.3467", 35, 30, "638.346700000000000000000000000000", "false"},
                                    {7, 4, "-255.0932", 35, 30, "-255.093200000000000000000000000000", "false"},
                                    {7, 4, "-306.4809", 35, 30, "-306.480900000000000000000000000000", "false"},
                                    {7, 4, "-965.8192", 35, 30, "-965.819200000000000000000000000000", "false"},
                                    {7, 4, "-999.5919", 35, 30, "-999.591900000000000000000000000000", "false"},
                                    {7, 4, "199.4652", 35, 30, "199.465200000000000000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL32, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal32p9s0Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 0, "62353632906866268", 9, 0, "", "true"},   {18, 0, "437969578225", 9, 0, "", "true"},
            {18, 0, "-382165708060839958", 9, 0, "", "true"}, {18, 0, "4699573240924616", 9, 0, "", "true"},
            {18, 0, "-372774144690130314", 9, 0, "", "true"}, {18, 0, "975137276942670195", 9, 0, "", "true"},
            {18, 0, "666307185069171099", 9, 0, "", "true"},  {18, 0, "-242119157735380041", 9, 0, "", "true"},
            {18, 0, "-998223666645745740", 9, 0, "", "true"}, {18, 0, "-999999996382702658", 9, 0, "", "true"},
            {18, 0, "-999788131973529504", 9, 0, "", "true"}, {18, 0, "-56840817742378155", 9, 0, "", "true"},
            {18, 0, "-998860764490409398", 9, 0, "", "true"}, {18, 0, "876172017953988132", 9, 0, "", "true"},
            {18, 0, "499907875988171499", 9, 0, "", "true"},  {18, 0, "-999714779261287057", 9, 0, "", "true"},
            {18, 0, "26682473038001488", 9, 0, "", "true"},   {18, 0, "471578182793120732", 9, 0, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{18, 0, "250225175", 9, 0, "250225175", "false"},
                                    {18, 0, "233", 9, 0, "233", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal32p9s2Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 0, "601693368125014961", 9, 2, "", "true"},  {18, 0, "206534768459878233", 9, 2, "", "true"},
            {18, 0, "-999999984944585100", 9, 2, "", "true"}, {18, 0, "537041697927604389", 9, 2, "", "true"},
            {18, 0, "-996967939130501764", 9, 2, "", "true"}, {18, 0, "904735421529935706", 9, 2, "", "true"},
            {18, 0, "-648692995558815408", 9, 2, "", "true"}, {18, 0, "296983852734370675", 9, 2, "", "true"},
            {18, 0, "-999999999999999996", 9, 2, "", "true"}, {18, 0, "-999999379070401058", 9, 2, "", "true"},
            {18, 0, "584261160856369922", 9, 2, "", "true"},  {18, 0, "314954310981238731", 9, 2, "", "true"},
            {18, 0, "-999999999999999998", 9, 2, "", "true"}, {18, 0, "-950009889224422830", 9, 2, "", "true"},
            {18, 0, "-610499692554440179", 9, 2, "", "true"}, {18, 0, "428857842570497416", 9, 2, "", "true"},
            {18, 0, "978750784119128388", 9, 2, "", "true"},  {18, 0, "-999962272340251459", 9, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {{18, 0, "113728", 9, 2, "113728", "false"}, {18, 0, "254", 9, 2, "254", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {{18, 0, "-336340163397370643", 9, 9, "", "true"},
                                    {18, 0, "-999999470311088359", 9, 9, "", "true"},
                                    {18, 0, "5888585", 9, 9, "", "true"},
                                    {18, 0, "-958113368214680516", 9, 9, "", "true"},
                                    {18, 0, "-874340379106950322", 9, 9, "", "true"},
                                    {18, 0, "1493798564780380", 9, 9, "", "true"},
                                    {18, 0, "28566748946040", 9, 9, "", "true"},
                                    {18, 0, "-790799909580426170", 9, 9, "", "true"},
                                    {18, 0, "-999999999945466380", 9, 9, "", "true"},
                                    {18, 0, "444845568323911611", 9, 9, "", "true"},
                                    {18, 0, "-999946852478495761", 9, 9, "", "true"},
                                    {18, 0, "-898050758931023611", 9, 9, "", "true"},
                                    {18, 0, "381475938070106143", 9, 9, "", "true"},
                                    {18, 0, "-914635545857970924", 9, 9, "", "true"},
                                    {18, 0, "-20943603094022585", 9, 9, "", "true"},
                                    {18, 0, "-167831113808478467", 9, 9, "", "true"},
                                    {18, 0, "-719131362852773259", 9, 9, "", "true"},
                                    {18, 0, "-999999999999999997", 9, 9, "", "true"},
                                    {18, 0, "13225796013680300", 9, 9, "", "true"},
                                    {18, 0, "-999999801317460068", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal32p7s4Abnormal) {
    CastTestCaseArray test_cases = {{18, 0, "337877682914608727", 7, 4, "", "true"},
                                    {18, 0, "-614569490076728098", 7, 4, "", "true"},
                                    {18, 0, "-195551592697023533", 7, 4, "", "true"},
                                    {18, 0, "-999999999999996635", 7, 4, "", "true"},
                                    {18, 0, "3019374", 7, 4, "", "true"},
                                    {18, 0, "-866515744877549519", 7, 4, "", "true"},
                                    {18, 0, "113252764308919377", 7, 4, "", "true"},
                                    {18, 0, "-998890087213876268", 7, 4, "", "true"},
                                    {18, 0, "695554880900410533", 7, 4, "", "true"},
                                    {18, 0, "-999999992007825690", 7, 4, "", "true"},
                                    {18, 0, "104282913553805690", 7, 4, "", "true"},
                                    {18, 0, "-79283888747886193", 7, 4, "", "true"},
                                    {18, 0, "331816229373384520", 7, 4, "", "true"},
                                    {18, 0, "463508856400828367", 7, 4, "", "true"},
                                    {18, 0, "-999999975070511956", 7, 4, "", "true"},
                                    {18, 0, "-999889929018120190", 7, 4, "", "true"},
                                    {18, 0, "789384138996238830", 7, 4, "", "true"},
                                    {18, 0, "-999999999954957138", 7, 4, "", "true"},
                                    {18, 0, "-999355358889466036", 7, 4, "", "true"},
                                    {18, 0, "-993804165895329007", 7, 4, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {{18, 0, "-171512823646662370", 18, 0, "-171512823646662370", "false"},
                                    {18, 0, "411", 18, 0, "411", "false"},
                                    {18, 0, "0", 18, 0, "0", "false"},
                                    {18, 0, "202044626611229132", 18, 0, "202044626611229132", "false"},
                                    {18, 0, "857604862427839409", 18, 0, "857604862427839409", "false"},
                                    {18, 0, "576956548359428494", 18, 0, "576956548359428494", "false"},
                                    {18, 0, "-277810463239211238", 18, 0, "-277810463239211238", "false"},
                                    {18, 0, "-999921040894791807", 18, 0, "-999921040894791807", "false"},
                                    {18, 0, "-931409901038258896", 18, 0, "-931409901038258896", "false"},
                                    {18, 0, "514294988331006643", 18, 0, "514294988331006643", "false"},
                                    {18, 0, "2537171053743", 18, 0, "2537171053743", "false"},
                                    {18, 0, "-439518724828119190", 18, 0, "-439518724828119190", "false"},
                                    {18, 0, "241215612605280903", 18, 0, "241215612605280903", "false"},
                                    {18, 0, "35557239637244393", 18, 0, "35557239637244393", "false"},
                                    {18, 0, "555357699982492363", 18, 0, "555357699982492363", "false"},
                                    {18, 0, "948275477391", 18, 0, "948275477391", "false"},
                                    {18, 0, "111026176793", 18, 0, "111026176793", "false"},
                                    {18, 0, "-999999998937693962", 18, 0, "-999999998937693962", "false"},
                                    {18, 0, "-596678126864948855", 18, 0, "-596678126864948855", "false"},
                                    {18, 0, "-998908992309786658", 18, 0, "-998908992309786658", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal64p18s2Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 0, "623680649822207344", 18, 2, "", "true"},  {18, 0, "-999997675006420102", 18, 2, "", "true"},
            {18, 0, "353171900606267991", 18, 2, "", "true"},  {18, 0, "-476612793601176013", 18, 2, "", "true"},
            {18, 0, "-990972647889267709", 18, 2, "", "true"}, {18, 0, "-677440787067204335", 18, 2, "", "true"},
            {18, 0, "506410175288532465", 18, 2, "", "true"},  {18, 0, "158047236061816596", 18, 2, "", "true"},
            {18, 0, "-359322791183308450", 18, 2, "", "true"}, {18, 0, "-999999999597679169", 18, 2, "", "true"},
            {18, 0, "-534229569997906380", 18, 2, "", "true"}, {18, 0, "359814067587084376", 18, 2, "", "true"},
            {18, 0, "-999999999998219305", 18, 2, "", "true"}, {18, 0, "685248141172538139", 18, 2, "", "true"},
            {18, 0, "-697377983127174999", 18, 2, "", "true"}, {18, 0, "529828036784947445", 18, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {{18, 0, "-643410752644667", 18, 2, "-643410752644667", "false"},
                                    {18, 0, "75104280376102742", 18, 2, "75104280376102742", "false"},
                                    {18, 0, "6385651482", 18, 2, "6385651482", "false"},
                                    {18, 0, "4204", 18, 2, "4204", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal64p18s9Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 0, "181245192904940234", 18, 9, "", "true"},  {18, 0, "887723145475622739", 18, 9, "", "true"},
            {18, 0, "-998119147108259209", 18, 9, "", "true"}, {18, 0, "-325413919518639157", 18, 9, "", "true"},
            {18, 0, "-965834800811987459", 18, 9, "", "true"}, {18, 0, "292016022333912419", 18, 9, "", "true"},
            {18, 0, "407827292779006927", 18, 9, "", "true"},  {18, 0, "-790761402451676426", 18, 9, "", "true"},
            {18, 0, "574266772810532418", 18, 9, "", "true"},  {18, 0, "-119723658577050783", 18, 9, "", "true"},
            {18, 0, "-955061075635800093", 18, 9, "", "true"}, {18, 0, "44661267736", 18, 9, "", "true"},
            {18, 0, "-999999983073760963", 18, 9, "", "true"}, {18, 0, "11299498906033", 18, 9, "", "true"},
            {18, 0, "-53238334714392569", 18, 9, "", "true"},  {18, 0, "-999998764911256327", 18, 9, "", "true"},
            {18, 0, "394228299301767013", 18, 9, "", "true"},  {18, 0, "965604985991451215", 18, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {{18, 0, "16358748", 18, 9, "16358748", "false"}, {18, 0, "6", 18, 9, "6", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 0, "12948691537504320", 18, 18, "", "true"},   {18, 0, "-999999999999977142", 18, 18, "", "true"},
            {18, 0, "626865638307283358", 18, 18, "", "true"},  {18, 0, "8136642", 18, 18, "", "true"},
            {18, 0, "371727416534361790", 18, 18, "", "true"},  {18, 0, "-999999566082576244", 18, 18, "", "true"},
            {18, 0, "-354085481350081987", 18, 18, "", "true"}, {18, 0, "-999994228298172901", 18, 18, "", "true"},
            {18, 0, "225976917145651784", 18, 18, "", "true"},  {18, 0, "30", 18, 18, "", "true"},
            {18, 0, "-713163422783549333", 18, 18, "", "true"}, {18, 0, "-999997149389989531", 18, 18, "", "true"},
            {18, 0, "195202713816442379", 18, 18, "", "true"},  {18, 0, "-999999995262730769", 18, 18, "", "true"},
            {18, 0, "-436231934686864364", 18, 18, "", "true"}, {18, 0, "-999874673393420662", 18, 18, "", "true"},
            {18, 0, "40532919390743784", 18, 18, "", "true"},   {18, 0, "-260930948424787703", 18, 18, "", "true"},
            {18, 0, "828885493708852018", 18, 18, "", "true"},  {18, 0, "530", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal64p15s13Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 0, "-999999999476477535", 15, 13, "", "true"}, {18, 0, "134468694051686897", 15, 13, "", "true"},
            {18, 0, "582625757538789109", 15, 13, "", "true"},  {18, 0, "-133155043172833679", 15, 13, "", "true"},
            {18, 0, "-961817070735803984", 15, 13, "", "true"}, {18, 0, "157539369029339714", 15, 13, "", "true"},
            {18, 0, "113306577865828971", 15, 13, "", "true"},  {18, 0, "-999999999999999998", 15, 13, "", "true"},
            {18, 0, "1492274588515", 15, 13, "", "true"},       {18, 0, "1664061", 15, 13, "", "true"},
            {18, 0, "827402437888258905", 15, 13, "", "true"},  {18, 0, "15767028015784513", 15, 13, "", "true"},
            {18, 0, "-558952280039076601", 15, 13, "", "true"}, {18, 0, "12292551097004893", 15, 13, "", "true"},
            {18, 0, "-383746767340512270", 15, 13, "", "true"}, {18, 0, "-999999999999645958", 15, 13, "", "true"},
            {18, 0, "-999999870032406348", 15, 13, "", "true"}, {18, 0, "-593426122758083812", 15, 13, "", "true"},
            {18, 0, "-634996827002257311", 15, 13, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{18, 0, "341", 15, 13, "341", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {{18, 0, "-999999999651252915", 38, 0, "-999999999651252915", "false"},
                                    {18, 0, "-704704299863142132", 38, 0, "-704704299863142132", "false"},
                                    {18, 0, "-946256738802762583", 38, 0, "-946256738802762583", "false"},
                                    {18, 0, "3725137830691", 38, 0, "3725137830691", "false"},
                                    {18, 0, "-507560769220654941", 38, 0, "-507560769220654941", "false"},
                                    {18, 0, "45492189", 38, 0, "45492189", "false"},
                                    {18, 0, "338538125322991624", 38, 0, "338538125322991624", "false"},
                                    {18, 0, "84602132891227", 38, 0, "84602132891227", "false"},
                                    {18, 0, "-999999999999938870", 38, 0, "-999999999999938870", "false"},
                                    {18, 0, "-999999826368527120", 38, 0, "-999999826368527120", "false"},
                                    {18, 0, "-105395015580545205", 38, 0, "-105395015580545205", "false"},
                                    {18, 0, "-999999970723662580", 38, 0, "-999999970723662580", "false"},
                                    {18, 0, "32461", 38, 0, "32461", "false"},
                                    {18, 0, "-999999999999993072", 38, 0, "-999999999999993072", "false"},
                                    {18, 0, "-830533324139404241", 38, 0, "-830533324139404241", "false"},
                                    {18, 0, "-199851478400518378", 38, 0, "-199851478400518378", "false"},
                                    {18, 0, "13", 38, 0, "13", "false"},
                                    {18, 0, "1601611836", 38, 0, "1601611836", "false"},
                                    {18, 0, "-44564294682891755", 38, 0, "-44564294682891755", "false"},
                                    {18, 0, "15752682", 38, 0, "15752682", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {{18, 0, "-932176869305790458", 38, 2, "-932176869305790458", "false"},
                                    {18, 0, "-999781590073741172", 38, 2, "-999781590073741172", "false"},
                                    {18, 0, "-999966181872278906", 38, 2, "-999966181872278906", "false"},
                                    {18, 0, "571146324236049784", 38, 2, "571146324236049784", "false"},
                                    {18, 0, "-999999999999999998", 38, 2, "-999999999999999998", "false"},
                                    {18, 0, "-471407012131343173", 38, 2, "-471407012131343173", "false"},
                                    {18, 0, "920386847539713286", 38, 2, "920386847539713286", "false"},
                                    {18, 0, "70762884094417107", 38, 2, "70762884094417107", "false"},
                                    {18, 0, "1837969895", 38, 2, "1837969895", "false"},
                                    {18, 0, "-131655509212964550", 38, 2, "-131655509212964550", "false"},
                                    {18, 0, "-999999999995337412", 38, 2, "-999999999995337412", "false"},
                                    {18, 0, "-847850348644903949", 38, 2, "-847850348644903949", "false"},
                                    {18, 0, "889440616883877927", 38, 2, "889440616883877927", "false"},
                                    {18, 0, "-999999988700545854", 38, 2, "-999999988700545854", "false"},
                                    {18, 0, "244851416284245956", 38, 2, "244851416284245956", "false"},
                                    {18, 0, "49932370184184849", 38, 2, "49932370184184849", "false"},
                                    {18, 0, "1941", 38, 2, "1941", "false"},
                                    {18, 0, "-259991682309327529", 38, 2, "-259991682309327529", "false"},
                                    {18, 0, "882557771258989209", 38, 2, "882557771258989209", "false"},
                                    {18, 0, "-999999999999990687", 38, 2, "-999999999999990687", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {{18, 0, "864982833803", 38, 9, "864982833803", "false"},
                                    {18, 0, "-404911027173748916", 38, 9, "-404911027173748916", "false"},
                                    {18, 0, "7", 38, 9, "7", "false"},
                                    {18, 0, "-679293049929071566", 38, 9, "-679293049929071566", "false"},
                                    {18, 0, "-999999999999999802", 38, 9, "-999999999999999802", "false"},
                                    {18, 0, "-767882319614281397", 38, 9, "-767882319614281397", "false"},
                                    {18, 0, "-153798356599924661", 38, 9, "-153798356599924661", "false"},
                                    {18, 0, "-999999999999762836", 38, 9, "-999999999999762836", "false"},
                                    {18, 0, "-101726984807845371", 38, 9, "-101726984807845371", "false"},
                                    {18, 0, "-999999999999996904", 38, 9, "-999999999999996904", "false"},
                                    {18, 0, "502392255630470026", 38, 9, "502392255630470026", "false"},
                                    {18, 0, "-999991236593731206", 38, 9, "-999991236593731206", "false"},
                                    {18, 0, "90430888310360645", 38, 9, "90430888310360645", "false"},
                                    {18, 0, "-999999999999610176", 38, 9, "-999999999999610176", "false"},
                                    {18, 0, "-999999999999935455", 38, 9, "-999999999999935455", "false"},
                                    {18, 0, "680520135275141908", 38, 9, "680520135275141908", "false"},
                                    {18, 0, "-999995304638643406", 38, 9, "-999995304638643406", "false"},
                                    {18, 0, "-998173790820210095", 38, 9, "-998173790820210095", "false"},
                                    {18, 0, "-92176075242479313", 38, 9, "-92176075242479313", "false"},
                                    {18, 0, "-999999999999886847", 38, 9, "-999999999999886847", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {{18, 0, "322432496705148859", 38, 13, "322432496705148859", "false"},
                                    {18, 0, "432664431858739398", 38, 13, "432664431858739398", "false"},
                                    {18, 0, "31094189594651", 38, 13, "31094189594651", "false"},
                                    {18, 0, "128945562566089461", 38, 13, "128945562566089461", "false"},
                                    {18, 0, "-970514820758296632", 38, 13, "-970514820758296632", "false"},
                                    {18, 0, "443656708115852361", 38, 13, "443656708115852361", "false"},
                                    {18, 0, "426161407505356982", 38, 13, "426161407505356982", "false"},
                                    {18, 0, "104195297122365020", 38, 13, "104195297122365020", "false"},
                                    {18, 0, "-701245817908651074", 38, 13, "-701245817908651074", "false"},
                                    {18, 0, "259048296603", 38, 13, "259048296603", "false"},
                                    {18, 0, "-999410520532252721", 38, 13, "-999410520532252721", "false"},
                                    {18, 0, "34405940400815", 38, 13, "34405940400815", "false"},
                                    {18, 0, "415591302471053387", 38, 13, "415591302471053387", "false"},
                                    {18, 0, "-999999999980084213", 38, 13, "-999999999980084213", "false"},
                                    {18, 0, "907394387702184258", 38, 13, "907394387702184258", "false"},
                                    {18, 0, "5", 38, 13, "5", "false"},
                                    {18, 0, "171886416135476631", 38, 13, "171886416135476631", "false"},
                                    {18, 0, "877230954473890567", 38, 13, "877230954473890567", "false"},
                                    {18, 0, "-989317532295903203", 38, 13, "-989317532295903203", "false"},
                                    {18, 0, "1976430357922", 38, 13, "1976430357922", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {{18, 0, "281789623665677658", 38, 18, "281789623665677658", "false"},
                                    {18, 0, "-989469551961896207", 38, 18, "-989469551961896207", "false"},
                                    {18, 0, "-999999999886358338", 38, 18, "-999999999886358338", "false"},
                                    {18, 0, "356947202490579023", 38, 18, "356947202490579023", "false"},
                                    {18, 0, "-999999995809994303", 38, 18, "-999999995809994303", "false"},
                                    {18, 0, "526523134591896875", 38, 18, "526523134591896875", "false"},
                                    {18, 0, "11220", 38, 18, "11220", "false"},
                                    {18, 0, "312931592986723601", 38, 18, "312931592986723601", "false"},
                                    {18, 0, "-453624235483394727", 38, 18, "-453624235483394727", "false"},
                                    {18, 0, "994618617595259292", 38, 18, "994618617595259292", "false"},
                                    {18, 0, "138693733", 38, 18, "138693733", "false"},
                                    {18, 0, "292548512320500526", 38, 18, "292548512320500526", "false"},
                                    {18, 0, "-706867834865849269", 38, 18, "-706867834865849269", "false"},
                                    {18, 0, "24841948244966087", 38, 18, "24841948244966087", "false"},
                                    {18, 0, "657590088894678853", 38, 18, "657590088894678853", "false"},
                                    {18, 0, "-135766043344016078", 38, 18, "-135766043344016078", "false"},
                                    {18, 0, "207", 38, 18, "207", "false"},
                                    {18, 0, "-331018339365899575", 38, 18, "-331018339365899575", "false"},
                                    {18, 0, "-999999996991507183", 38, 18, "-999999996991507183", "false"},
                                    {18, 0, "-999999663045375596", 38, 18, "-999999663045375596", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal128p35s30Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 0, "-935515052283902442", 35, 30, "", "true"}, {18, 0, "439117517425918755", 35, 30, "", "true"},
            {18, 0, "969131602416162260", 35, 30, "", "true"},  {18, 0, "335133852363196666", 35, 30, "", "true"},
            {18, 0, "855786775175027061", 35, 30, "", "true"},  {18, 0, "-999999999999999056", 35, 30, "", "true"},
            {18, 0, "-999999999999804705", 35, 30, "", "true"}, {18, 0, "-280017607509651665", 35, 30, "", "true"},
            {18, 0, "-999997438789854036", 35, 30, "", "true"}, {18, 0, "687544459380112171", 35, 30, "", "true"},
            {18, 0, "682001279885567525", 35, 30, "", "true"},  {18, 0, "-999999993801890670", 35, 30, "", "true"},
            {18, 0, "9666917554", 35, 30, "", "true"},          {18, 0, "-7888121533609479", 35, 30, "", "true"},
            {18, 0, "351301001115956", 35, 30, "", "true"},     {18, 0, "400902328798085779", 35, 30, "", "true"},
            {18, 0, "438230326633765312", 35, 30, "", "true"},  {18, 0, "-991939911119622644", 35, 30, "", "true"},
            {18, 0, "920041055613109526", 35, 30, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s0ToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {{18, 0, "8", 35, 30, "8", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal32p9s0Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 2, "4461580116640370.26", 9, 0, "", "true"},  {18, 2, "-9999996520153101.63", 9, 0, "", "true"},
            {18, 2, "-9432317930528683.88", 9, 0, "", "true"}, {18, 2, "9882129217725840.46", 9, 0, "", "true"},
            {18, 2, "-9999999999999999.90", 9, 0, "", "true"}, {18, 2, "-9879615440385085.38", 9, 0, "", "true"},
            {18, 2, "-9999999999999971.94", 9, 0, "", "true"}, {18, 2, "-9999999997691121.71", 9, 0, "", "true"},
            {18, 2, "-8702247209928915.71", 9, 0, "", "true"}, {18, 2, "-8330605883229272.88", 9, 0, "", "true"},
            {18, 2, "-3978940238759610.09", 9, 0, "", "true"}, {18, 2, "-1631343046047241.09", 9, 0, "", "true"},
            {18, 2, "-7210663099240584.34", 9, 0, "", "true"}, {18, 2, "-8341228797771586.36", 9, 0, "", "true"},
            {18, 2, "-3119370455619318.29", 9, 0, "", "true"}, {18, 2, "-9999999999998011.50", 9, 0, "", "true"},
            {18, 2, "-9557016340300732.48", 9, 0, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{18, 2, "2890.23", 9, 0, "2890", "false"},
                                    {18, 2, "24.10", 9, 0, "24", "false"},
                                    {18, 2, "0.07", 9, 0, "0", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal32p9s2Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 2, "-9999999999999999.86", 9, 2, "", "true"}, {18, 2, "2557592685033200.72", 9, 2, "", "true"},
            {18, 2, "-9873233975759215.19", 9, 2, "", "true"}, {18, 2, "-9999989509933467.32", 9, 2, "", "true"},
            {18, 2, "-3814169423103858.16", 9, 2, "", "true"}, {18, 2, "-9999999999998930.73", 9, 2, "", "true"},
            {18, 2, "-9999999999999993.06", 9, 2, "", "true"}, {18, 2, "-4448409242181646.43", 9, 2, "", "true"},
            {18, 2, "-4969652134707601.99", 9, 2, "", "true"}, {18, 2, "-9983442451619573.07", 9, 2, "", "true"},
            {18, 2, "-9999999999673753.06", 9, 2, "", "true"}, {18, 2, "-1134001817950391.97", 9, 2, "", "true"},
            {18, 2, "453381796423.22", 9, 2, "", "true"},      {18, 2, "-6763983168954964.79", 9, 2, "", "true"},
            {18, 2, "-7019906538159925.63", 9, 2, "", "true"}, {18, 2, "-9999999999999998.14", 9, 2, "", "true"},
            {18, 2, "8966445715763705.17", 9, 2, "", "true"},  {18, 2, "-1511963705581764.05", 9, 2, "", "true"},
            {18, 2, "-1715128236466623.70", 9, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {{18, 2, "4652645.80", 9, 2, "4652645.80", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 2, "-9999999999999999.95", 9, 9, "", "true"}, {18, 2, "-2071556657984065.13", 9, 9, "", "true"},
            {18, 2, "-9999999999997669.01", 9, 9, "", "true"}, {18, 2, "-1564007716784657.14", 9, 9, "", "true"},
            {18, 2, "4611427660362535.43", 9, 9, "", "true"},  {18, 2, "2839184905726581.59", 9, 9, "", "true"},
            {18, 2, "-9853409590722319.58", 9, 9, "", "true"}, {18, 2, "-1690190102617975.63", 9, 9, "", "true"},
            {18, 2, "-7655286157447930.18", 9, 9, "", "true"}, {18, 2, "4703114918191882.23", 9, 9, "", "true"},
            {18, 2, "-9999996844313660.79", 9, 9, "", "true"}, {18, 2, "3047774310895256.26", 9, 9, "", "true"},
            {18, 2, "169785120.73", 9, 9, "", "true"},         {18, 2, "-1508625779166231.81", 9, 9, "", "true"},
            {18, 2, "2304383433324930.69", 9, 9, "", "true"},  {18, 2, "-7717089847365066.57", 9, 9, "", "true"},
            {18, 2, "-2923131152445319.84", 9, 9, "", "true"}, {18, 2, "-8132488537194600.99", 9, 9, "", "true"},
            {18, 2, "-9996409787436000.91", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal32p9s9Normal) {
    CastTestCaseArray test_cases = {{18, 2, "0.02", 9, 9, "0.020000000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal32p7s4Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 2, "3883354695343920.17", 7, 4, "", "true"},  {18, 2, "-9304327063751207.53", 7, 4, "", "true"},
            {18, 2, "-4152090892979406.53", 7, 4, "", "true"}, {18, 2, "-9795126516194177.72", 7, 4, "", "true"},
            {18, 2, "-9999785867142055.71", 7, 4, "", "true"}, {18, 2, "-9999742138264713.88", 7, 4, "", "true"},
            {18, 2, "-2054809230189512.80", 7, 4, "", "true"}, {18, 2, "9422674648766.43", 7, 4, "", "true"},
            {18, 2, "-1651834729028607.26", 7, 4, "", "true"}, {18, 2, "-2525132387355681.09", 7, 4, "", "true"},
            {18, 2, "1244637314315705.28", 7, 4, "", "true"},  {18, 2, "9255293163471425.34", 7, 4, "", "true"},
            {18, 2, "429945356877938.20", 7, 4, "", "true"},   {18, 2, "-5756282168185059.43", 7, 4, "", "true"},
            {18, 2, "-9999999999999998.18", 7, 4, "", "true"}, {18, 2, "2750252688196339.95", 7, 4, "", "true"},
            {18, 2, "-9999999999999999.96", 7, 4, "", "true"}, {18, 2, "-5772662584906304.25", 7, 4, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal32p7s4Normal) {
    CastTestCaseArray test_cases = {{18, 2, "52.12", 7, 4, "52.1200", "false"},
                                    {18, 2, "2.41", 7, 4, "2.4100", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {{18, 2, "3456420.16", 18, 0, "3456420", "false"},
                                    {18, 2, "-2905492669773009.38", 18, 0, "-2905492669773009", "false"},
                                    {18, 2, "5012642360580004.12", 18, 0, "5012642360580004", "false"},
                                    {18, 2, "-9843921779709866.57", 18, 0, "-9843921779709867", "false"},
                                    {18, 2, "-9999999962247303.07", 18, 0, "-9999999962247303", "false"},
                                    {18, 2, "-1581123094993413.24", 18, 0, "-1581123094993413", "false"},
                                    {18, 2, "-9999999999917353.88", 18, 0, "-9999999999917354", "false"},
                                    {18, 2, "-5935887460701296.98", 18, 0, "-5935887460701297", "false"},
                                    {18, 2, "4440491383877083.38", 18, 0, "4440491383877083", "false"},
                                    {18, 2, "31703.76", 18, 0, "31704", "false"},
                                    {18, 2, "6887127889155067.34", 18, 0, "6887127889155067", "false"},
                                    {18, 2, "-9999999999999997.59", 18, 0, "-9999999999999998", "false"},
                                    {18, 2, "5660319585936471.81", 18, 0, "5660319585936472", "false"},
                                    {18, 2, "9313673778775448.70", 18, 0, "9313673778775449", "false"},
                                    {18, 2, "-7975335656397915.68", 18, 0, "-7975335656397916", "false"},
                                    {18, 2, "-8694368321123943.44", 18, 0, "-8694368321123943", "false"},
                                    {18, 2, "9352368065848838.86", 18, 0, "9352368065848839", "false"},
                                    {18, 2, "-9998803063290982.29", 18, 0, "-9998803063290982", "false"},
                                    {18, 2, "-7440144884202649.22", 18, 0, "-7440144884202649", "false"},
                                    {18, 2, "5988015459.00", 18, 0, "5988015459", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {{18, 2, "-1828285724105170.19", 18, 2, "-1828285724105170.19", "false"},
                                    {18, 2, "23.63", 18, 2, "23.63", "false"},
                                    {18, 2, "145910356605.48", 18, 2, "145910356605.48", "false"},
                                    {18, 2, "5981532616559446.00", 18, 2, "5981532616559446", "false"},
                                    {18, 2, "4143.68", 18, 2, "4143.68", "false"},
                                    {18, 2, "29789.17", 18, 2, "29789.17", "false"},
                                    {18, 2, "-5199306255864057.32", 18, 2, "-5199306255864057.32", "false"},
                                    {18, 2, "4723852.37", 18, 2, "4723852.37", "false"},
                                    {18, 2, "386681656.55", 18, 2, "386681656.55", "false"},
                                    {18, 2, "8284871763533376.28", 18, 2, "8284871763533376.28", "false"},
                                    {18, 2, "9113922840005563.78", 18, 2, "9113922840005563.78", "false"},
                                    {18, 2, "-9999999542481684.97", 18, 2, "-9999999542481684.97", "false"},
                                    {18, 2, "0.01", 18, 2, "0.01", "false"},
                                    {18, 2, "1135.39", 18, 2, "1135.39", "false"},
                                    {18, 2, "2382545449034404.02", 18, 2, "2382545449034404.02", "false"},
                                    {18, 2, "-3435000691625916.75", 18, 2, "-3435000691625916.75", "false"},
                                    {18, 2, "40724863519.97", 18, 2, "40724863519.97", "false"},
                                    {18, 2, "-8701643474464977.31", 18, 2, "-8701643474464977.31", "false"},
                                    {18, 2, "8910416349319822.59", 18, 2, "8910416349319822.59", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal64p18s9Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 2, "-3671502071396371.88", 18, 9, "", "true"}, {18, 2, "-7442587569190397.30", 18, 9, "", "true"},
            {18, 2, "-9409337863422443.33", 18, 9, "", "true"}, {18, 2, "-2769140313058342.89", 18, 9, "", "true"},
            {18, 2, "-9999999927625016.73", 18, 9, "", "true"}, {18, 2, "19051500872.05", 18, 9, "", "true"},
            {18, 2, "-9083007869135464.28", 18, 9, "", "true"}, {18, 2, "-1769835399423554.32", 18, 9, "", "true"},
            {18, 2, "-2333929399527870.21", 18, 9, "", "true"}, {18, 2, "-9999999999999999.85", 18, 9, "", "true"},
            {18, 2, "3768772911806421.63", 18, 9, "", "true"},  {18, 2, "-9999999999999999.87", 18, 9, "", "true"},
            {18, 2, "-9999978868732189.53", 18, 9, "", "true"}, {18, 2, "-9999845946670202.60", 18, 9, "", "true"},
            {18, 2, "-9999999999999999.88", 18, 9, "", "true"}, {18, 2, "-8287910328795968.68", 18, 9, "", "true"},
            {18, 2, "6239727449092741.75", 18, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {{18, 2, "380440.81", 18, 9, "380440.810000000", "false"},
                                    {18, 2, "437499.56", 18, 9, "437499.560000000", "false"},
                                    {18, 2, "50.31", 18, 9, "50.310000000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {{18, 2, "-3378852462562805.20", 18, 18, "", "true"},
                                    {18, 2, "-1183567847441436.74", 18, 18, "", "true"},
                                    {18, 2, "-9999994689902404.37", 18, 18, "", "true"},
                                    {18, 2, "5759684161935785.52", 18, 18, "", "true"},
                                    {18, 2, "-7566898671339694.74", 18, 18, "", "true"},
                                    {18, 2, "205396.85", 18, 18, "", "true"},
                                    {18, 2, "7811737913533081.98", 18, 18, "", "true"},
                                    {18, 2, "-7866675854624119.98", 18, 18, "", "true"},
                                    {18, 2, "7736456796234580.62", 18, 18, "", "true"},
                                    {18, 2, "206273289646502.84", 18, 18, "", "true"},
                                    {18, 2, "2456634618882.94", 18, 18, "", "true"},
                                    {18, 2, "-9999999414776903.92", 18, 18, "", "true"},
                                    {18, 2, "4135037025147739.73", 18, 18, "", "true"},
                                    {18, 2, "216.98", 18, 18, "", "true"},
                                    {18, 2, "4623757942566558.41", 18, 18, "", "true"},
                                    {18, 2, "-7748662350265168.97", 18, 18, "", "true"},
                                    {18, 2, "-1002080715480357.85", 18, 18, "", "true"},
                                    {18, 2, "-9999999999999999.87", 18, 18, "", "true"},
                                    {18, 2, "25.56", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal64p18s18Normal) {
    CastTestCaseArray test_cases = {{18, 2, "0.00", 18, 18, "0", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal64p15s13Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 2, "-6088529479225613.92", 15, 13, "", "true"}, {18, 2, "-7216358581212764.70", 15, 13, "", "true"},
            {18, 2, "-9999999999999999.95", 15, 13, "", "true"}, {18, 2, "235516765026142.82", 15, 13, "", "true"},
            {18, 2, "9994549532455276.45", 15, 13, "", "true"},  {18, 2, "9681464892494028.66", 15, 13, "", "true"},
            {18, 2, "-2543612122109341.28", 15, 13, "", "true"}, {18, 2, "-2688588087352168.86", 15, 13, "", "true"},
            {18, 2, "-9999999998805172.59", 15, 13, "", "true"}, {18, 2, "-6889942353306183.86", 15, 13, "", "true"},
            {18, 2, "9449275460372514.28", 15, 13, "", "true"},  {18, 2, "5520484706849577.32", 15, 13, "", "true"},
            {18, 2, "-1715128236466623.70", 15, 13, "", "true"}, {18, 2, "-9999999999983124.24", 15, 13, "", "true"},
            {18, 2, "201427204714100.60", 15, 13, "", "true"},   {18, 2, "-8346752051569085.76", 15, 13, "", "true"},
            {18, 2, "-6479738901406934.64", 15, 13, "", "true"}, {18, 2, "1933546152130758.34", 15, 13, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{18, 2, "16501.70", 15, 13, "16501.7000000000000", "false"},
                                    {18, 2, "27.18", 15, 13, "27.1800000000000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {{18, 2, "-2954369625519397.57", 38, 0, "-2954369625519398", "false"},
                                    {18, 2, "-8224192194343631.13", 38, 0, "-8224192194343631", "false"},
                                    {18, 2, "-4406987804953133.77", 38, 0, "-4406987804953134", "false"},
                                    {18, 2, "-9999999999999901.73", 38, 0, "-9999999999999902", "false"},
                                    {18, 2, "-9587809751579536.51", 38, 0, "-9587809751579537", "false"},
                                    {18, 2, "588024230.66", 38, 0, "588024231", "false"},
                                    {18, 2, "8179138324451771.61", 38, 0, "8179138324451772", "false"},
                                    {18, 2, "112145577963.63", 38, 0, "112145577964", "false"},
                                    {18, 2, "332.62", 38, 0, "333", "false"},
                                    {18, 2, "4595043980646912.05", 38, 0, "4595043980646912", "false"},
                                    {18, 2, "-9999999999999959.19", 38, 0, "-9999999999999959", "false"},
                                    {18, 2, "-9463513085372416.00", 38, 0, "-9463513085372416", "false"},
                                    {18, 2, "2719612618419560.62", 38, 0, "2719612618419561", "false"},
                                    {18, 2, "-9989287938639087.65", 38, 0, "-9989287938639088", "false"},
                                    {18, 2, "-9999999852150356.26", 38, 0, "-9999999852150356", "false"},
                                    {18, 2, "-605751956610909.86", 38, 0, "-605751956610910", "false"},
                                    {18, 2, "46226051.74", 38, 0, "46226052", "false"},
                                    {18, 2, "37245652.33", 38, 0, "37245652", "false"},
                                    {18, 2, "-3366519333775944.95", 38, 0, "-3366519333775945", "false"},
                                    {18, 2, "-9999999999999999.65", 38, 0, "-10000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {{18, 2, "-9999999992603175.27", 38, 2, "-9999999992603175.27", "false"},
                                    {18, 2, "-9999999999999307.70", 38, 2, "-9999999999999307.70", "false"},
                                    {18, 2, "2237351231951331.74", 38, 2, "2237351231951331.74", "false"},
                                    {18, 2, "-7921897041311240.82", 38, 2, "-7921897041311240.82", "false"},
                                    {18, 2, "-7716154583867208.40", 38, 2, "-7716154583867208.40", "false"},
                                    {18, 2, "1585448429167335.05", 38, 2, "1585448429167335.05", "false"},
                                    {18, 2, "2309269016239607.84", 38, 2, "2309269016239607.84", "false"},
                                    {18, 2, "-9999999999999979.67", 38, 2, "-9999999999999979.67", "false"},
                                    {18, 2, "-9834247724555512.51", 38, 2, "-9834247724555512.51", "false"},
                                    {18, 2, "468223.20", 38, 2, "468223.20", "false"},
                                    {18, 2, "50.14", 38, 2, "50.14", "false"},
                                    {18, 2, "-584949387435197.77", 38, 2, "-584949387435197.77", "false"},
                                    {18, 2, "1254666277504260.23", 38, 2, "1254666277504260.23", "false"},
                                    {18, 2, "616440239388440.95", 38, 2, "616440239388440.95", "false"},
                                    {18, 2, "-9999999999961267.33", 38, 2, "-9999999999961267.33", "false"},
                                    {18, 2, "9239789540791260.44", 38, 2, "9239789540791260.44", "false"},
                                    {18, 2, "5404005631219341.98", 38, 2, "5404005631219341.98", "false"},
                                    {18, 2, "4424904091368752.99", 38, 2, "4424904091368752.99", "false"},
                                    {18, 2, "6320205149882637.26", 38, 2, "6320205149882637.26", "false"},
                                    {18, 2, "3035978842166791.90", 38, 2, "3035978842166791.90", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {{18, 2, "4236642822526868.02", 38, 9, "4236642822526868.020000000", "false"},
                                    {18, 2, "-6168816089689983.89", 38, 9, "-6168816089689983.890000000", "false"},
                                    {18, 2, "-9619521569852881.83", 38, 9, "-9619521569852881.830000000", "false"},
                                    {18, 2, "-4279397155930456.30", 38, 9, "-4279397155930456.300000000", "false"},
                                    {18, 2, "6.03", 38, 9, "6.030000000", "false"},
                                    {18, 2, "-7568579110620686.46", 38, 9, "-7568579110620686.460000000", "false"},
                                    {18, 2, "-9821536943190761.70", 38, 9, "-9821536943190761.700000000", "false"},
                                    {18, 2, "22.57", 38, 9, "22.570000000", "false"},
                                    {18, 2, "-9999992905856443.78", 38, 9, "-9999992905856443.780000000", "false"},
                                    {18, 2, "8703811795788161.07", 38, 9, "8703811795788161.070000000", "false"},
                                    {18, 2, "-9999999999999873.03", 38, 9, "-9999999999999873.030000000", "false"},
                                    {18, 2, "196.83", 38, 9, "196.830000000", "false"},
                                    {18, 2, "-2139554949642460.51", 38, 9, "-2139554949642460.510000000", "false"},
                                    {18, 2, "8784076769251530.79", 38, 9, "8784076769251530.790000000", "false"},
                                    {18, 2, "13.79", 38, 9, "13.790000000", "false"},
                                    {18, 2, "5441440838547964.57", 38, 9, "5441440838547964.570000000", "false"},
                                    {18, 2, "-9999999992052114.93", 38, 9, "-9999999992052114.930000000", "false"},
                                    {18, 2, "-6834931036259086.50", 38, 9, "-6834931036259086.500000000", "false"},
                                    {18, 2, "-2180858900251760.93", 38, 9, "-2180858900251760.930000000", "false"},
                                    {18, 2, "2210236529500052.71", 38, 9, "2210236529500052.710000000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {
            {18, 2, "-9999508516357459.52", 38, 13, "-9999508516357459.5200000000000", "false"},
            {18, 2, "1386344980194963.22", 38, 13, "1386344980194963.2200000000000", "false"},
            {18, 2, "535282551161918.70", 38, 13, "535282551161918.7000000000000", "false"},
            {18, 2, "2194286.22", 38, 13, "2194286.2200000000000", "false"},
            {18, 2, "748546.71", 38, 13, "748546.7100000000000", "false"},
            {18, 2, "2096924304799379.04", 38, 13, "2096924304799379.0400000000000", "false"},
            {18, 2, "6889361567405832.45", 38, 13, "6889361567405832.4500000000000", "false"},
            {18, 2, "158601800.40", 38, 13, "158601800.4000000000000", "false"},
            {18, 2, "-9999999998869341.59", 38, 13, "-9999999998869341.5900000000000", "false"},
            {18, 2, "-4025293269451074.90", 38, 13, "-4025293269451074.9000000000000", "false"},
            {18, 2, "945.61", 38, 13, "945.6100000000000", "false"},
            {18, 2, "23646673378293.93", 38, 13, "23646673378293.9300000000000", "false"},
            {18, 2, "252451843025710.51", 38, 13, "252451843025710.5100000000000", "false"},
            {18, 2, "-1589061627291395.63", 38, 13, "-1589061627291395.6300000000000", "false"},
            {18, 2, "-3970396682471960.56", 38, 13, "-3970396682471960.5600000000000", "false"},
            {18, 2, "-9747014509972812.86", 38, 13, "-9747014509972812.8600000000000", "false"},
            {18, 2, "-739180546272288.91", 38, 13, "-739180546272288.9100000000000", "false"},
            {18, 2, "-6707499229048843.17", 38, 13, "-6707499229048843.1700000000000", "false"},
            {18, 2, "0.00", 38, 13, "0", "false"},
            {18, 2, "-6914305457968051.09", 38, 13, "-6914305457968051.0900000000000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {
            {18, 2, "-3342386550974128.80", 38, 18, "-3342386550974128.800000000000000000", "false"},
            {18, 2, "-9999999999999953.33", 38, 18, "-9999999999999953.330000000000000000", "false"},
            {18, 2, "-5692300639196824.40", 38, 18, "-5692300639196824.400000000000000000", "false"},
            {18, 2, "0.82", 38, 18, "0.820000000000000000", "false"},
            {18, 2, "507020571.94", 38, 18, "507020571.940000000000000000", "false"},
            {18, 2, "9847328187545745.70", 38, 18, "9847328187545745.700000000000000000", "false"},
            {18, 2, "0.33", 38, 18, "0.330000000000000000", "false"},
            {18, 2, "4065368087582905.52", 38, 18, "4065368087582905.520000000000000000", "false"},
            {18, 2, "34175382537583.08", 38, 18, "34175382537583.080000000000000000", "false"},
            {18, 2, "-9999999999999996.31", 38, 18, "-9999999999999996.310000000000000000", "false"},
            {18, 2, "104688277389463.46", 38, 18, "104688277389463.460000000000000000", "false"},
            {18, 2, "4441699062652727.97", 38, 18, "4441699062652727.970000000000000000", "false"},
            {18, 2, "-9999999999712974.85", 38, 18, "-9999999999712974.850000000000000000", "false"},
            {18, 2, "-8291607383666694.99", 38, 18, "-8291607383666694.990000000000000000", "false"},
            {18, 2, "-392348024635191.23", 38, 18, "-392348024635191.230000000000000000", "false"},
            {18, 2, "-1883411246815446.94", 38, 18, "-1883411246815446.940000000000000000", "false"},
            {18, 2, "-8064297527296742.07", 38, 18, "-8064297527296742.070000000000000000", "false"},
            {18, 2, "-3273610530197554.98", 38, 18, "-3273610530197554.980000000000000000", "false"},
            {18, 2, "-9999377871064252.53", 38, 18, "-9999377871064252.530000000000000000", "false"},
            {18, 2, "4699752.10", 38, 18, "4699752.100000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal128p35s30Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 2, "-9999999999999258.13", 35, 30, "", "true"}, {18, 2, "4592976169556110.17", 35, 30, "", "true"},
            {18, 2, "-3878764984868729.29", 35, 30, "", "true"}, {18, 2, "8645995849607619.64", 35, 30, "", "true"},
            {18, 2, "1800263863204850.31", 35, 30, "", "true"},  {18, 2, "9556917574362324.50", 35, 30, "", "true"},
            {18, 2, "-9999999999999999.78", 35, 30, "", "true"}, {18, 2, "2278579055650956.37", 35, 30, "", "true"},
            {18, 2, "-8922205711214787.71", 35, 30, "", "true"}, {18, 2, "-7079258963496659.19", 35, 30, "", "true"},
            {18, 2, "-8606285696891217.39", 35, 30, "", "true"}, {18, 2, "3825087989249051.99", 35, 30, "", "true"},
            {18, 2, "-2319978385641335.41", 35, 30, "", "true"}, {18, 2, "2687839716783.15", 35, 30, "", "true"},
            {18, 2, "-9999999999812778.45", 35, 30, "", "true"}, {18, 2, "-8378315653924419.54", 35, 30, "", "true"},
            {18, 2, "4746030800588021.94", 35, 30, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s2ToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {{18, 2, "35.74", 35, 30, "35.740000000000000000000000000000", "false"},
                                    {18, 2, "6.82", 35, 30, "6.820000000000000000000000000000", "false"},
                                    {18, 2, "0.10", 35, 30, "0.100000000000000000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{18, 9, "-273704970.648242999", 9, 0, "-273704971", "false"},
                                    {18, 9, "-999951812.594723177", 9, 0, "-999951813", "false"},
                                    {18, 9, "-999999999.970581592", 9, 0, "-1000000000", "false"},
                                    {18, 9, "894679938.566339858", 9, 0, "894679939", "false"},
                                    {18, 9, "271.325706369", 9, 0, "271", "false"},
                                    {18, 9, "-999999994.973900505", 9, 0, "-999999995", "false"},
                                    {18, 9, "-795222884.923370232", 9, 0, "-795222885", "false"},
                                    {18, 9, "-40299578.676577096", 9, 0, "-40299579", "false"},
                                    {18, 9, "-374489086.677622674", 9, 0, "-374489087", "false"},
                                    {18, 9, "-944386906.742807819", 9, 0, "-944386907", "false"},
                                    {18, 9, "494698393.273953259", 9, 0, "494698393", "false"},
                                    {18, 9, "4E-9", 9, 0, "0", "false"},
                                    {18, 9, "-21200531.399990534", 9, 0, "-21200531", "false"},
                                    {18, 9, "0E-9", 9, 0, "0", "false"},
                                    {18, 9, "-768931568.327381661", 9, 0, "-768931568", "false"},
                                    {18, 9, "-662319536.339672573", 9, 0, "-662319536", "false"},
                                    {18, 9, "1.8E-8", 9, 0, "0", "false"},
                                    {18, 9, "-680887932.008159697", 9, 0, "-680887932", "false"},
                                    {18, 9, "0.000617621", 9, 0, "0", "false"},
                                    {18, 9, "-856238205.856152624", 9, 0, "-856238206", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal32p9s2Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 9, "653613832.368303475", 9, 2, "", "true"},  {18, 9, "260773146.966296305", 9, 2, "", "true"},
            {18, 9, "-999999987.218176170", 9, 2, "", "true"}, {18, 9, "-156483974.427600171", 9, 2, "", "true"},
            {18, 9, "-999999865.682495637", 9, 2, "", "true"}, {18, 9, "711816938.793273272", 9, 2, "", "true"},
            {18, 9, "-999999945.849480024", 9, 2, "", "true"}, {18, 9, "-999999999.712417146", 9, 2, "", "true"},
            {18, 9, "-56842690.842561969", 9, 2, "", "true"},  {18, 9, "-819652276.847197703", 9, 2, "", "true"},
            {18, 9, "129190413.083841565", 9, 2, "", "true"},  {18, 9, "663439016.838600524", 9, 2, "", "true"},
            {18, 9, "-285541058.375997513", 9, 2, "", "true"}, {18, 9, "111512583.792640344", 9, 2, "", "true"},
            {18, 9, "326251070.181304279", 9, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {{18, 9, "1.2E-8", 9, 2, "0", "false"},
                                    {18, 9, "5.2E-8", 9, 2, "0", "false"},
                                    {18, 9, "11.132900991", 9, 2, "11.13", "false"},
                                    {18, 9, "2.1E-8", 9, 2, "0", "false"},
                                    {18, 9, "0.092284275", 9, 2, "0.09", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 9, "-999999999.999999965", 9, 9, "", "true"}, {18, 9, "758640335.286902556", 9, 9, "", "true"},
            {18, 9, "245946008.702486823", 9, 9, "", "true"},  {18, 9, "-280559276.305708817", 9, 9, "", "true"},
            {18, 9, "-306648565.643259459", 9, 9, "", "true"}, {18, 9, "-999999999.776712600", 9, 9, "", "true"},
            {18, 9, "-999991097.517259679", 9, 9, "", "true"}, {18, 9, "-262833703.862934809", 9, 9, "", "true"},
            {18, 9, "-574068661.346412091", 9, 9, "", "true"}, {18, 9, "960845822.948939015", 9, 9, "", "true"},
            {18, 9, "-999912920.004242280", 9, 9, "", "true"}, {18, 9, "273120888.582337751", 9, 9, "", "true"},
            {18, 9, "-999999999.999999502", 9, 9, "", "true"}, {18, 9, "437.785639357", 9, 9, "", "true"},
            {18, 9, "365524234.665417458", 9, 9, "", "true"},  {18, 9, "6587127.355893562", 9, 9, "", "true"},
            {18, 9, "828487176.353337628", 9, 9, "", "true"},  {18, 9, "-702180506.502332122", 9, 9, "", "true"},
            {18, 9, "528464943.201397379", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal32p9s9Normal) {
    CastTestCaseArray test_cases = {{18, 9, "2E-9", 9, 9, "0.000000002", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal32p7s4Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 9, "-187669284.676068886", 7, 4, "", "true"}, {18, 9, "671728420.476552374", 7, 4, "", "true"},
            {18, 9, "-584671010.492360561", 7, 4, "", "true"}, {18, 9, "-918512923.527886090", 7, 4, "", "true"},
            {18, 9, "1873050.607936008", 7, 4, "", "true"},    {18, 9, "508545033.918473981", 7, 4, "", "true"},
            {18, 9, "618481049.085537962", 7, 4, "", "true"},  {18, 9, "-469179264.248891389", 7, 4, "", "true"},
            {18, 9, "-414341430.705085307", 7, 4, "", "true"}, {18, 9, "190353438.460612661", 7, 4, "", "true"},
            {18, 9, "851119984.251029363", 7, 4, "", "true"},  {18, 9, "40453555.885652202", 7, 4, "", "true"},
            {18, 9, "-999999999.999999760", 7, 4, "", "true"}, {18, 9, "-999999994.364660450", 7, 4, "", "true"},
            {18, 9, "-999999999.999975255", 7, 4, "", "true"}, {18, 9, "-376354898.563684906", 7, 4, "", "true"},
            {18, 9, "491601130.379913621", 7, 4, "", "true"},  {18, 9, "-999991292.991721115", 7, 4, "", "true"},
            {18, 9, "-999999999.999617815", 7, 4, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal32p7s4Normal) {
    CastTestCaseArray test_cases = {{18, 9, "0.454931256", 7, 4, "0.4549", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {{18, 9, "-964651155.694703716", 18, 0, "-964651156", "false"},
                                    {18, 9, "-999999999.116295787", 18, 0, "-999999999", "false"},
                                    {18, 9, "-999999999.966487134", 18, 0, "-1000000000", "false"},
                                    {18, 9, "791956314.073574044", 18, 0, "791956314", "false"},
                                    {18, 9, "-25242830.814992345", 18, 0, "-25242831", "false"},
                                    {18, 9, "-999999999.997639070", 18, 0, "-1000000000", "false"},
                                    {18, 9, "-999999995.351985649", 18, 0, "-999999995", "false"},
                                    {18, 9, "701520231.825607657", 18, 0, "701520232", "false"},
                                    {18, 9, "0.112410893", 18, 0, "0", "false"},
                                    {18, 9, "523767901.261365369", 18, 0, "523767901", "false"},
                                    {18, 9, "310723678.782782053", 18, 0, "310723679", "false"},
                                    {18, 9, "-646206473.174449118", 18, 0, "-646206473", "false"},
                                    {18, 9, "-866920581.515051474", 18, 0, "-866920582", "false"},
                                    {18, 9, "-77320098.487035474", 18, 0, "-77320098", "false"},
                                    {18, 9, "-970837300.228089010", 18, 0, "-970837300", "false"},
                                    {18, 9, "741929154.697398989", 18, 0, "741929155", "false"},
                                    {18, 9, "-51098564.358652479", 18, 0, "-51098564", "false"},
                                    {18, 9, "922546.207999796", 18, 0, "922546", "false"},
                                    {18, 9, "303.896046660", 18, 0, "304", "false"},
                                    {18, 9, "-832745113.296921457", 18, 0, "-832745113", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {{18, 9, "-60846252.298411676", 18, 2, "-60846252.30", "false"},
                                    {18, 9, "89454725.583643668", 18, 2, "89454725.58", "false"},
                                    {18, 9, "-8191383.294243284", 18, 2, "-8191383.29", "false"},
                                    {18, 9, "-775175692.635509490", 18, 2, "-775175692.64", "false"},
                                    {18, 9, "491313256.869573444", 18, 2, "491313256.87", "false"},
                                    {18, 9, "412052279.876397393", 18, 2, "412052279.88", "false"},
                                    {18, 9, "863319501.613748595", 18, 2, "863319501.61", "false"},
                                    {18, 9, "-519582564.527155019", 18, 2, "-519582564.53", "false"},
                                    {18, 9, "-996407314.785212307", 18, 2, "-996407314.79", "false"},
                                    {18, 9, "0.000038239", 18, 2, "0", "false"},
                                    {18, 9, "-895709356.016829518", 18, 2, "-895709356.02", "false"},
                                    {18, 9, "95230589.370201386", 18, 2, "95230589.37", "false"},
                                    {18, 9, "-355348123.985739890", 18, 2, "-355348123.99", "false"},
                                    {18, 9, "-988113163.497417649", 18, 2, "-988113163.50", "false"},
                                    {18, 9, "47333.193540269", 18, 2, "47333.19", "false"},
                                    {18, 9, "-951636457.148431858", 18, 2, "-951636457.15", "false"},
                                    {18, 9, "0.017888631", 18, 2, "0.02", "false"},
                                    {18, 9, "-999999999.994797020", 18, 2, "-999999999.99", "false"},
                                    {18, 9, "-999999999.999993600", 18, 2, "-1000000000", "false"},
                                    {18, 9, "-352995715.115581006", 18, 2, "-352995715.12", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {{18, 9, "-852151473.415350642", 18, 9, "-852151473.415350642", "false"},
                                    {18, 9, "0.115525114", 18, 9, "0.115525114", "false"},
                                    {18, 9, "-999999999.999998913", 18, 9, "-999999999.999998913", "false"},
                                    {18, 9, "0.000728443", 18, 9, "0.000728443", "false"},
                                    {18, 9, "-539230009.908497973", 18, 9, "-539230009.908497973", "false"},
                                    {18, 9, "8588649.968440254", 18, 9, "8588649.968440254", "false"},
                                    {18, 9, "523871507.800373049", 18, 9, "523871507.800373049", "false"},
                                    {18, 9, "-50806470.165916609", 18, 9, "-50806470.165916609", "false"},
                                    {18, 9, "-997954724.627584774", 18, 9, "-997954724.627584774", "false"},
                                    {18, 9, "444169754.599774694", 18, 9, "444169754.599774694", "false"},
                                    {18, 9, "-999111671.009634063", 18, 9, "-999111671.009634063", "false"},
                                    {18, 9, "-997758875.827848929", 18, 9, "-997758875.827848929", "false"},
                                    {18, 9, "-999998946.592976486", 18, 9, "-999998946.592976486", "false"},
                                    {18, 9, "-554048117.833112178", 18, 9, "-554048117.833112178", "false"},
                                    {18, 9, "7601.489867134", 18, 9, "7601.489867134", "false"},
                                    {18, 9, "229411012.684519068", 18, 9, "229411012.684519068", "false"},
                                    {18, 9, "-999999999.999999985", 18, 9, "-999999999.999999985", "false"},
                                    {18, 9, "-824914898.307196331", 18, 9, "-824914898.307196331", "false"},
                                    {18, 9, "4.00E-7", 18, 9, "0.000000400", "false"},
                                    {18, 9, "-548305688.283765704", 18, 9, "-548305688.283765704", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 9, "-999170579.758158428", 18, 18, "", "true"}, {18, 9, "369118648.928360789", 18, 18, "", "true"},
            {18, 9, "259217126.405275482", 18, 18, "", "true"},  {18, 9, "565816311.975893003", 18, 18, "", "true"},
            {18, 9, "-999990740.501538118", 18, 18, "", "true"}, {18, 9, "115.543456148", 18, 18, "", "true"},
            {18, 9, "-976003578.991107535", 18, 18, "", "true"}, {18, 9, "223.588412868", 18, 18, "", "true"},
            {18, 9, "19719086.685828565", 18, 18, "", "true"},   {18, 9, "111.890502191", 18, 18, "", "true"},
            {18, 9, "771555858.838550727", 18, 18, "", "true"},  {18, 9, "12845968.652812386", 18, 18, "", "true"},
            {18, 9, "898922954.099460862", 18, 18, "", "true"},  {18, 9, "-939190122.681988650", 18, 18, "", "true"},
            {18, 9, "-999999995.737561071", 18, 18, "", "true"}, {18, 9, "999621056.787823798", 18, 18, "", "true"},
            {18, 9, "-999999999.999999994", 18, 18, "", "true"}, {18, 9, "-999999999.999999401", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal64p18s18Normal) {
    CastTestCaseArray test_cases = {{18, 9, "0.123000452", 18, 18, "0.123000452000000000", "false"},
                                    {18, 9, "0.000001968", 18, 18, "0.000001968000000000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal64p15s13Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 9, "7312190.092054838", 15, 13, "", "true"},    {18, 9, "-999999999.842541498", 15, 13, "", "true"},
            {18, 9, "6292856.143872092", 15, 13, "", "true"},    {18, 9, "-996813393.951465520", 15, 13, "", "true"},
            {18, 9, "336972989.898642303", 15, 13, "", "true"},  {18, 9, "-999999999.932614173", 15, 13, "", "true"},
            {18, 9, "-999999999.999999997", 15, 13, "", "true"}, {18, 9, "-777854802.228499421", 15, 13, "", "true"},
            {18, 9, "-999999999.999999988", 15, 13, "", "true"}, {18, 9, "-447468703.850278133", 15, 13, "", "true"},
            {18, 9, "-886908870.440684987", 15, 13, "", "true"}, {18, 9, "-490335964.083487440", 15, 13, "", "true"},
            {18, 9, "-999114041.617164066", 15, 13, "", "true"}, {18, 9, "-931514158.364007709", 15, 13, "", "true"},
            {18, 9, "1529625.606404766", 15, 13, "", "true"},    {18, 9, "-581439458.678186788", 15, 13, "", "true"},
            {18, 9, "951269907.214826676", 15, 13, "", "true"},  {18, 9, "463731240.428178341", 15, 13, "", "true"},
            {18, 9, "89288330.807858426", 15, 13, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{18, 9, "0.009920177", 15, 13, "0.0099201770000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {{18, 9, "954936592.702072661", 38, 0, "954936593", "false"},
                                    {18, 9, "4176.395964673", 38, 0, "4176", "false"},
                                    {18, 9, "-884649762.031260424", 38, 0, "-884649762", "false"},
                                    {18, 9, "109958701.389882538", 38, 0, "109958701", "false"},
                                    {18, 9, "451216659.858266964", 38, 0, "451216660", "false"},
                                    {18, 9, "213552133.031761388", 38, 0, "213552133", "false"},
                                    {18, 9, "-987082412.476741746", 38, 0, "-987082412", "false"},
                                    {18, 9, "280561143.781521643", 38, 0, "280561144", "false"},
                                    {18, 9, "0.000001186", 38, 0, "0", "false"},
                                    {18, 9, "872092141.079036062", 38, 0, "872092141", "false"},
                                    {18, 9, "377728472.166715929", 38, 0, "377728472", "false"},
                                    {18, 9, "374656250.422503555", 38, 0, "374656250", "false"},
                                    {18, 9, "-160231125.412023304", 38, 0, "-160231125", "false"},
                                    {18, 9, "960764.797541594", 38, 0, "960765", "false"},
                                    {18, 9, "-776744893.290819240", 38, 0, "-776744893", "false"},
                                    {18, 9, "3.86E-7", 38, 0, "0", "false"},
                                    {18, 9, "-520970458.148476042", 38, 0, "-520970458", "false"},
                                    {18, 9, "-752572214.263063161", 38, 0, "-752572214", "false"},
                                    {18, 9, "0.000001443", 38, 0, "0", "false"},
                                    {18, 9, "-189633312.121352484", 38, 0, "-189633312", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {{18, 9, "153223010.885837297", 38, 2, "153223010.89", "false"},
                                    {18, 9, "-629919996.852875806", 38, 2, "-629919996.85", "false"},
                                    {18, 9, "3.52E-7", 38, 2, "0", "false"},
                                    {18, 9, "-54569115.818990210", 38, 2, "-54569115.82", "false"},
                                    {18, 9, "-836078281.881691345", 38, 2, "-836078281.88", "false"},
                                    {18, 9, "0.005402555", 38, 2, "0.01", "false"},
                                    {18, 9, "0E-9", 38, 2, "0", "false"},
                                    {18, 9, "-228008890.182383244", 38, 2, "-228008890.18", "false"},
                                    {18, 9, "-438043661.913197440", 38, 2, "-438043661.91", "false"},
                                    {18, 9, "440950869.336093367", 38, 2, "440950869.34", "false"},
                                    {18, 9, "3.236037310", 38, 2, "3.24", "false"},
                                    {18, 9, "0.000432083", 38, 2, "0", "false"},
                                    {18, 9, "-637799342.105174952", 38, 2, "-637799342.11", "false"},
                                    {18, 9, "-999999952.594487565", 38, 2, "-999999952.59", "false"},
                                    {18, 9, "0.000003206", 38, 2, "0", "false"},
                                    {18, 9, "4.4E-8", 38, 2, "0", "false"},
                                    {18, 9, "347921878.134516856", 38, 2, "347921878.13", "false"},
                                    {18, 9, "48738788.021463151", 38, 2, "48738788.02", "false"},
                                    {18, 9, "0.000901406", 38, 2, "0", "false"},
                                    {18, 9, "-999999999.999999823", 38, 2, "-1000000000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {{18, 9, "277926742.744104788", 38, 9, "277926742.744104788", "false"},
                                    {18, 9, "-158030043.437698465", 38, 9, "-158030043.437698465", "false"},
                                    {18, 9, "-192775435.844564572", 38, 9, "-192775435.844564572", "false"},
                                    {18, 9, "-952209274.639240093", 38, 9, "-952209274.639240093", "false"},
                                    {18, 9, "4.419418757", 38, 9, "4.419418757", "false"},
                                    {18, 9, "672531183.573837176", 38, 9, "672531183.573837176", "false"},
                                    {18, 9, "-999999999.999999997", 38, 9, "-999999999.999999997", "false"},
                                    {18, 9, "-952366500.231103720", 38, 9, "-952366500.231103720", "false"},
                                    {18, 9, "-836282496.365916351", 38, 9, "-836282496.365916351", "false"},
                                    {18, 9, "-999999999.999998946", 38, 9, "-999999999.999998946", "false"},
                                    {18, 9, "-521017940.189691812", 38, 9, "-521017940.189691812", "false"},
                                    {18, 9, "-999999931.671548060", 38, 9, "-999999931.671548060", "false"},
                                    {18, 9, "0.000092603", 38, 9, "0.000092603", "false"},
                                    {18, 9, "-999999999.999999998", 38, 9, "-999999999.999999998", "false"},
                                    {18, 9, "39704057.691106077", 38, 9, "39704057.691106077", "false"},
                                    {18, 9, "-989888844.714903672", 38, 9, "-989888844.714903672", "false"},
                                    {18, 9, "-999999999.999999941", 38, 9, "-999999999.999999941", "false"},
                                    {18, 9, "1443271.363329399", 38, 9, "1443271.363329399", "false"},
                                    {18, 9, "35.692840415", 38, 9, "35.692840415", "false"},
                                    {18, 9, "-999999905.690626758", 38, 9, "-999999905.690626758", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {{18, 9, "-999999999.999999998", 38, 13, "-999999999.9999999980000", "false"},
                                    {18, 9, "-46671605.193128328", 38, 13, "-46671605.1931283280000", "false"},
                                    {18, 9, "-994062309.972252882", 38, 13, "-994062309.9722528820000", "false"},
                                    {18, 9, "-136785529.898643885", 38, 13, "-136785529.8986438850000", "false"},
                                    {18, 9, "-999999999.999999977", 38, 13, "-999999999.9999999770000", "false"},
                                    {18, 9, "-394388956.284820746", 38, 13, "-394388956.2848207460000", "false"},
                                    {18, 9, "-867655033.871392250", 38, 13, "-867655033.8713922500000", "false"},
                                    {18, 9, "58197416.023570854", 38, 13, "58197416.0235708540000", "false"},
                                    {18, 9, "-999999999.999997703", 38, 13, "-999999999.9999977030000", "false"},
                                    {18, 9, "1.610336998", 38, 13, "1.6103369980000", "false"},
                                    {18, 9, "105.072088310", 38, 13, "105.0720883100000", "false"},
                                    {18, 9, "-819031302.767030719", 38, 13, "-819031302.7670307190000", "false"},
                                    {18, 9, "-232024042.687871173", 38, 13, "-232024042.6878711730000", "false"},
                                    {18, 9, "1083.364243017", 38, 13, "1083.3642430170000", "false"},
                                    {18, 9, "7.47E-7", 38, 13, "0.0000007470000", "false"},
                                    {18, 9, "15161692.165512649", 38, 13, "15161692.1655126490000", "false"},
                                    {18, 9, "441875623.861330773", 38, 13, "441875623.8613307730000", "false"},
                                    {18, 9, "-214803445.508987884", 38, 13, "-214803445.5089878840000", "false"},
                                    {18, 9, "416961868.591517578", 38, 13, "416961868.5915175780000", "false"},
                                    {18, 9, "-999999999.999999974", 38, 13, "-999999999.9999999740000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {{18, 9, "-927331248.956272812", 38, 18, "-927331248.956272812000000000", "false"},
                                    {18, 9, "-999998028.007055501", 38, 18, "-999998028.007055501000000000", "false"},
                                    {18, 9, "787019509.953967908", 38, 18, "787019509.953967908000000000", "false"},
                                    {18, 9, "2E-9", 38, 18, "0.000000002000000000", "false"},
                                    {18, 9, "-999999999.999999363", 38, 18, "-999999999.999999363000000000", "false"},
                                    {18, 9, "9.2E-8", 38, 18, "0.000000092000000000", "false"},
                                    {18, 9, "-999999999.999999359", 38, 18, "-999999999.999999359000000000", "false"},
                                    {18, 9, "-992227441.132066633", 38, 18, "-992227441.132066633000000000", "false"},
                                    {18, 9, "840518615.584014650", 38, 18, "840518615.584014650000000000", "false"},
                                    {18, 9, "440109830.542881299", 38, 18, "440109830.542881299000000000", "false"},
                                    {18, 9, "-724896613.046903796", 38, 18, "-724896613.046903796000000000", "false"},
                                    {18, 9, "366257019.203197142", 38, 18, "366257019.203197142000000000", "false"},
                                    {18, 9, "-778934178.788908332", 38, 18, "-778934178.788908332000000000", "false"},
                                    {18, 9, "-373098223.990402640", 38, 18, "-373098223.990402640000000000", "false"},
                                    {18, 9, "745331723.282338211", 38, 18, "745331723.282338211000000000", "false"},
                                    {18, 9, "-294372627.792773469", 38, 18, "-294372627.792773469000000000", "false"},
                                    {18, 9, "938099136.915973108", 38, 18, "938099136.915973108000000000", "false"},
                                    {18, 9, "235924853.410549414", 38, 18, "235924853.410549414000000000", "false"},
                                    {18, 9, "-966400580.834812923", 38, 18, "-966400580.834812923000000000", "false"},
                                    {18, 9, "-996018502.606803586", 38, 18, "-996018502.606803586000000000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal128p35s30Abnormal) {
    CastTestCaseArray test_cases = {
            {18, 9, "-805462722.665602722", 35, 30, "", "true"}, {18, 9, "-550034960.520761608", 35, 30, "", "true"},
            {18, 9, "-484888231.538761530", 35, 30, "", "true"}, {18, 9, "-999999999.999999997", 35, 30, "", "true"},
            {18, 9, "-225211343.113115978", 35, 30, "", "true"}, {18, 9, "-984414939.978240457", 35, 30, "", "true"},
            {18, 9, "-682491864.439530124", 35, 30, "", "true"}, {18, 9, "636104624.281219646", 35, 30, "", "true"},
            {18, 9, "487314095.478275335", 35, 30, "", "true"},  {18, 9, "265139469.001232959", 35, 30, "", "true"},
            {18, 9, "-999999999.999999994", 35, 30, "", "true"}, {18, 9, "-999999966.959821375", 35, 30, "", "true"},
            {18, 9, "-999999425.056883842", 35, 30, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s9ToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {
            {18, 9, "0.061034691", 35, 30, "0.061034691000000000000000000000", "false"},
            {18, 9, "6192670.071539429", 35, 30, "6192670.071539429000000000000000000000", "false"},
            {18, 9, "13077762.561851149", 35, 30, "13077762.561851149000000000000000000000", "false"},
            {18, 9, "-14004497.110981618", 35, 30, "-14004497.110981618000000000000000000000", "false"},
            {18, 9, "28291.605276774", 35, 30, "28291.605276774000000000000000000000", "false"},
            {18, 9, "33.135842607", 35, 30, "33.135842607000000000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s18ToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{18, 18, "-0.999999999998438315", 9, 0, "-1", "false"},
                                    {18, 18, "-0.772496862138321157", 9, 0, "-1", "false"},
                                    {18, 18, "-0.639315384896982091", 9, 0, "-1", "false"},
                                    {18, 18, "0.501529807735378224", 9, 0, "1", "false"},
                                    {18, 18, "0.650905927472803212", 9, 0, "1", "false"},
                                    {18, 18, "0.380192941072618339", 9, 0, "0", "false"},
                                    {18, 18, "-0.741502917090644819", 9, 0, "-1", "false"},
                                    {18, 18, "-0.306837426616190413", 9, 0, "0", "false"},
                                    {18, 18, "0.487486634880372469", 9, 0, "0", "false"},
                                    {18, 18, "-0.999996180397373657", 9, 0, "-1", "false"},
                                    {18, 18, "0.629922191172542835", 9, 0, "1", "false"},
                                    {18, 18, "0.087296540748017893", 9, 0, "0", "false"},
                                    {18, 18, "6.99E-16", 9, 0, "0", "false"},
                                    {18, 18, "1.713E-15", 9, 0, "0", "false"},
                                    {18, 18, "-0.553446673810571762", 9, 0, "-1", "false"},
                                    {18, 18, "-0.999999999999999828", 9, 0, "-1", "false"},
                                    {18, 18, "6.01575575879E-7", 9, 0, "0", "false"},
                                    {18, 18, "-0.999844213528430293", 9, 0, "-1", "false"},
                                    {18, 18, "-0.999999999999997168", 9, 0, "-1", "false"},
                                    {18, 18, "0.664753593249717619", 9, 0, "1", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s18ToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {{18, 18, "0.373008144719840059", 9, 2, "0.37", "false"},
                                    {18, 18, "-0.998157240769805052", 9, 2, "-1", "false"},
                                    {18, 18, "-0.476873439603286639", 9, 2, "-0.48", "false"},
                                    {18, 18, "0.719809130388459673", 9, 2, "0.72", "false"},
                                    {18, 18, "2.47665133569E-7", 9, 2, "0", "false"},
                                    {18, 18, "-0.434899778369899290", 9, 2, "-0.43", "false"},
                                    {18, 18, "0.129444944899953547", 9, 2, "0.13", "false"},
                                    {18, 18, "-0.639009446318934870", 9, 2, "-0.64", "false"},
                                    {18, 18, "5.66235E-13", 9, 2, "0", "false"},
                                    {18, 18, "-0.999999999999989884", 9, 2, "-1", "false"},
                                    {18, 18, "6.64991083951E-7", 9, 2, "0", "false"},
                                    {18, 18, "1.0342342E-11", 9, 2, "0", "false"},
                                    {18, 18, "-0.323892339679977889", 9, 2, "-0.32", "false"},
                                    {18, 18, "0.671990078007028849", 9, 2, "0.67", "false"},
                                    {18, 18, "-0.999999999999836648", 9, 2, "-1", "false"},
                                    {18, 18, "0.000154689385381988", 9, 2, "0", "false"},
                                    {18, 18, "1.49492272148E-7", 9, 2, "0", "false"},
                                    {18, 18, "0.000044583561431379", 9, 2, "0", "false"},
                                    {18, 18, "8.8152E-14", 9, 2, "0", "false"},
                                    {18, 18, "0.650192376827641634", 9, 2, "0.65", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s18ToDecimal32p9s9Normal) {
    CastTestCaseArray test_cases = {{18, 18, "2.63575362E-10", 9, 9, "0", "false"},
                                    {18, 18, "0.122028574722448521", 9, 9, "0.122028575", "false"},
                                    {18, 18, "0.824997380937888637", 9, 9, "0.824997381", "false"},
                                    {18, 18, "-0.707893398971194154", 9, 9, "-0.707893399", "false"},
                                    {18, 18, "-0.783873151705760607", 9, 9, "-0.783873152", "false"},
                                    {18, 18, "0.526276593829776770", 9, 9, "0.526276594", "false"},
                                    {18, 18, "0.321547930428092837", 9, 9, "0.321547930", "false"},
                                    {18, 18, "1.548088367E-9", 9, 9, "0.000000002", "false"},
                                    {18, 18, "-0.410487246408588789", 9, 9, "-0.410487246", "false"},
                                    {18, 18, "0.186287777526087276", 9, 9, "0.186287778", "false"},
                                    {18, 18, "0.994181172158351854", 9, 9, "0.994181172", "false"},
                                    {18, 18, "8.05194E-13", 9, 9, "0", "false"},
                                    {18, 18, "6.7492262926E-8", 9, 9, "0.000000067", "false"},
                                    {18, 18, "-0.999999966155919193", 9, 9, "-0.999999966", "false"},
                                    {18, 18, "-0.102607214994443000", 9, 9, "-0.102607215", "false"},
                                    {18, 18, "0.860613133735023061", 9, 9, "0.860613134", "false"},
                                    {18, 18, "-0.999900590667537369", 9, 9, "-0.999900591", "false"},
                                    {18, 18, "0.412958509936596133", 9, 9, "0.412958510", "false"},
                                    {18, 18, "-0.999988678671058562", 9, 9, "-0.999988679", "false"},
                                    {18, 18, "0.126962224233968736", 9, 9, "0.126962224", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s18ToDecimal32p7s4Normal) {
    CastTestCaseArray test_cases = {{18, 18, "0.693252219160734949", 7, 4, "0.6933", "false"},
                                    {18, 18, "0.000454345205118787", 7, 4, "0.0005", "false"},
                                    {18, 18, "-0.678087267249121643", 7, 4, "-0.6781", "false"},
                                    {18, 18, "-0.972772912375109901", 7, 4, "-0.9728", "false"},
                                    {18, 18, "3E-18", 7, 4, "0", "false"},
                                    {18, 18, "-0.279246554104750402", 7, 4, "-0.2792", "false"},
                                    {18, 18, "0.332830403704257687", 7, 4, "0.3328", "false"},
                                    {18, 18, "0.438744182949815984", 7, 4, "0.4387", "false"},
                                    {18, 18, "-0.706220636723013549", 7, 4, "-0.7062", "false"},
                                    {18, 18, "0.456857277514805137", 7, 4, "0.4569", "false"},
                                    {18, 18, "-0.880749193322982300", 7, 4, "-0.8807", "false"},
                                    {18, 18, "5.7E-17", 7, 4, "0", "false"},
                                    {18, 18, "-0.072390542204840036", 7, 4, "-0.0724", "false"},
                                    {18, 18, "-0.999989330329675987", 7, 4, "-1", "false"},
                                    {18, 18, "-0.999999935212130552", 7, 4, "-1", "false"},
                                    {18, 18, "0.790872631538471592", 7, 4, "0.7909", "false"},
                                    {18, 18, "-0.663878674282082114", 7, 4, "-0.6639", "false"},
                                    {18, 18, "-0.387308354937050065", 7, 4, "-0.3873", "false"},
                                    {18, 18, "0.259822910618291472", 7, 4, "0.2598", "false"},
                                    {18, 18, "-0.999997365756163146", 7, 4, "-1", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s18ToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {{18, 18, "1.3E-17", 18, 0, "0", "false"},
                                    {18, 18, "-0.963089069498576255", 18, 0, "-1", "false"},
                                    {18, 18, "0.709439313236734998", 18, 0, "1", "false"},
                                    {18, 18, "-0.999999999446764081", 18, 0, "-1", "false"},
                                    {18, 18, "-0.484459579325203747", 18, 0, "0", "false"},
                                    {18, 18, "0.764909615101511575", 18, 0, "1", "false"},
                                    {18, 18, "-0.999999997966754951", 18, 0, "-1", "false"},
                                    {18, 18, "-0.617527872112644932", 18, 0, "-1", "false"},
                                    {18, 18, "0.788586392791564563", 18, 0, "1", "false"},
                                    {18, 18, "-0.523291788770228447", 18, 0, "-1", "false"},
                                    {18, 18, "-0.725587979035777174", 18, 0, "-1", "false"},
                                    {18, 18, "0.411192894160448989", 18, 0, "0", "false"},
                                    {18, 18, "-0.318852782118090379", 18, 0, "0", "false"},
                                    {18, 18, "0.025619625157147524", 18, 0, "0", "false"},
                                    {18, 18, "-0.990580986626051575", 18, 0, "-1", "false"},
                                    {18, 18, "-0.657340950842599269", 18, 0, "-1", "false"},
                                    {18, 18, "-0.999999999999999998", 18, 0, "-1", "false"},
                                    {18, 18, "0.406750833177445577", 18, 0, "0", "false"},
                                    {18, 18, "-0.772344430026692004", 18, 0, "-1", "false"},
                                    {18, 18, "-0.998532396102390073", 18, 0, "-1", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s18ToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {{18, 18, "1.173592E-12", 18, 2, "0", "false"},
                                    {18, 18, "-0.634248662249916408", 18, 2, "-0.63", "false"},
                                    {18, 18, "0.000017499276769592", 18, 2, "0", "false"},
                                    {18, 18, "0.074083147268997017", 18, 2, "0.07", "false"},
                                    {18, 18, "-0.999999999999658053", 18, 2, "-1", "false"},
                                    {18, 18, "0.766290425270070416", 18, 2, "0.77", "false"},
                                    {18, 18, "0.934147969071678136", 18, 2, "0.93", "false"},
                                    {18, 18, "-0.800078955312753047", 18, 2, "-0.80", "false"},
                                    {18, 18, "0.688629804044033974", 18, 2, "0.69", "false"},
                                    {18, 18, "-0.999999999999985968", 18, 2, "-1", "false"},
                                    {18, 18, "-0.127521798169517994", 18, 2, "-0.13", "false"},
                                    {18, 18, "0.559376320162752754", 18, 2, "0.56", "false"},
                                    {18, 18, "-0.598322457301887231", 18, 2, "-0.60", "false"},
                                    {18, 18, "-0.999999999991721415", 18, 2, "-1", "false"},
                                    {18, 18, "7.30189929513E-7", 18, 2, "0", "false"},
                                    {18, 18, "-0.249810453445564895", 18, 2, "-0.25", "false"},
                                    {18, 18, "0.181275839657359702", 18, 2, "0.18", "false"},
                                    {18, 18, "-0.913773850203461236", 18, 2, "-0.91", "false"},
                                    {18, 18, "0.340341282431574574", 18, 2, "0.34", "false"},
                                    {18, 18, "-0.874888203211651798", 18, 2, "-0.87", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s18ToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {{18, 18, "0.000023795871179213", 18, 9, "0.000023796", "false"},
                                    {18, 18, "-0.999999999884656374", 18, 9, "-1", "false"},
                                    {18, 18, "-0.999999968337148779", 18, 9, "-0.999999968", "false"},
                                    {18, 18, "3.94878409858E-7", 18, 9, "0.000000395", "false"},
                                    {18, 18, "-0.746944800074041818", 18, 9, "-0.746944800", "false"},
                                    {18, 18, "0.028757627193018459", 18, 9, "0.028757627", "false"},
                                    {18, 18, "-0.999762229558809366", 18, 9, "-0.999762230", "false"},
                                    {18, 18, "0.450629871756855213", 18, 9, "0.450629872", "false"},
                                    {18, 18, "-0.683404570420887736", 18, 9, "-0.683404570", "false"},
                                    {18, 18, "1E-18", 18, 9, "0", "false"},
                                    {18, 18, "-0.999999990272089237", 18, 9, "-0.999999990", "false"},
                                    {18, 18, "-0.999999993116407920", 18, 9, "-0.999999993", "false"},
                                    {18, 18, "0.735809373726064340", 18, 9, "0.735809374", "false"},
                                    {18, 18, "-0.046605354021108503", 18, 9, "-0.046605354", "false"},
                                    {18, 18, "-0.999999752422873934", 18, 9, "-0.999999752", "false"},
                                    {18, 18, "-0.856444623067618956", 18, 9, "-0.856444623", "false"},
                                    {18, 18, "0.238267998134782327", 18, 9, "0.238267998", "false"},
                                    {18, 18, "0.455810320805620882", 18, 9, "0.455810321", "false"},
                                    {18, 18, "-0.036729630294961185", 18, 9, "-0.036729630", "false"},
                                    {18, 18, "-0.925414827987022974", 18, 9, "-0.925414828", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s18ToDecimal64p18s18Normal) {
    CastTestCaseArray test_cases = {{18, 18, "-0.739209942908309148", 18, 18, "-0.739209942908309148", "false"},
                                    {18, 18, "-0.721842505529073057", 18, 18, "-0.721842505529073057", "false"},
                                    {18, 18, "-0.999999999999999995", 18, 18, "-0.999999999999999995", "false"},
                                    {18, 18, "0.000001757562189743", 18, 18, "0.000001757562189743", "false"},
                                    {18, 18, "-0.999999999763759573", 18, 18, "-0.999999999763759573", "false"},
                                    {18, 18, "-0.999999999999990939", 18, 18, "-0.999999999999990939", "false"},
                                    {18, 18, "-0.999999903769330891", 18, 18, "-0.999999903769330891", "false"},
                                    {18, 18, "1.7319404E-11", 18, 18, "0.000000000017319404", "false"},
                                    {18, 18, "-0.207837521115302299", 18, 18, "-0.207837521115302299", "false"},
                                    {18, 18, "-0.835483716219182738", 18, 18, "-0.835483716219182738", "false"},
                                    {18, 18, "-0.249170481571616404", 18, 18, "-0.249170481571616404", "false"},
                                    {18, 18, "0.000106959367436740", 18, 18, "0.000106959367436740", "false"},
                                    {18, 18, "9E-18", 18, 18, "0.000000000000000009", "false"},
                                    {18, 18, "7.44245E-13", 18, 18, "0.000000000000744245", "false"},
                                    {18, 18, "-0.109885892238038200", 18, 18, "-0.109885892238038200", "false"},
                                    {18, 18, "0.739057235910845364", 18, 18, "0.739057235910845364", "false"},
                                    {18, 18, "0.011556752991737024", 18, 18, "0.011556752991737024", "false"},
                                    {18, 18, "0.602069482262002950", 18, 18, "0.602069482262002950", "false"},
                                    {18, 18, "0.003251852014735872", 18, 18, "0.003251852014735872", "false"},
                                    {18, 18, "0.223073187778296959", 18, 18, "0.223073187778296959", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s18ToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{18, 18, "-0.485726331236057413", 15, 13, "-0.4857263312361", "false"},
                                    {18, 18, "-0.997901557743448214", 15, 13, "-0.9979015577434", "false"},
                                    {18, 18, "-0.999999999999740600", 15, 13, "-0.9999999999997", "false"},
                                    {18, 18, "-0.974722315229617248", 15, 13, "-0.9747223152296", "false"},
                                    {18, 18, "-0.998657232869994261", 15, 13, "-0.9986572328700", "false"},
                                    {18, 18, "-0.999992979569136944", 15, 13, "-0.9999929795691", "false"},
                                    {18, 18, "-0.900952974060488346", 15, 13, "-0.9009529740605", "false"},
                                    {18, 18, "-0.284327528992512502", 15, 13, "-0.2843275289925", "false"},
                                    {18, 18, "2.42793425864E-7", 15, 13, "0.0000002427934", "false"},
                                    {18, 18, "0.436117082511540818", 15, 13, "0.4361170825115", "false"},
                                    {18, 18, "0.102176104188791117", 15, 13, "0.1021761041888", "false"},
                                    {18, 18, "0.443966253906891867", 15, 13, "0.4439662539069", "false"},
                                    {18, 18, "-0.241086220033328617", 15, 13, "-0.2410862200333", "false"},
                                    {18, 18, "-0.999999999993105798", 15, 13, "-0.9999999999931", "false"},
                                    {18, 18, "0.609198827423489773", 15, 13, "0.6091988274235", "false"},
                                    {18, 18, "5.45820E-13", 15, 13, "0.0000000000005", "false"},
                                    {18, 18, "-0.198231891876530119", 15, 13, "-0.1982318918765", "false"},
                                    {18, 18, "-0.810505833971235944", 15, 13, "-0.8105058339712", "false"},
                                    {18, 18, "0.738799964593000471", 15, 13, "0.7387999645930", "false"},
                                    {18, 18, "-0.432155435558958156", 15, 13, "-0.4321554355590", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s18ToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {{18, 18, "0.392323539796346990", 38, 0, "0", "false"},
                                    {18, 18, "-0.073829671172075770", 38, 0, "0", "false"},
                                    {18, 18, "4.489E-15", 38, 0, "0", "false"},
                                    {18, 18, "-0.465977274621946535", 38, 0, "0", "false"},
                                    {18, 18, "1.3950293E-11", 38, 0, "0", "false"},
                                    {18, 18, "4.0E-17", 38, 0, "0", "false"},
                                    {18, 18, "0.400249360948031292", 38, 0, "0", "false"},
                                    {18, 18, "2.964E-15", 38, 0, "0", "false"},
                                    {18, 18, "8.33299E-13", 38, 0, "0", "false"},
                                    {18, 18, "3E-18", 38, 0, "0", "false"},
                                    {18, 18, "6.203E-15", 38, 0, "0", "false"},
                                    {18, 18, "-0.713030945296498287", 38, 0, "-1", "false"},
                                    {18, 18, "0.702723235130256083", 38, 0, "1", "false"},
                                    {18, 18, "-0.225883071674356690", 38, 0, "0", "false"},
                                    {18, 18, "-0.999999999968624719", 38, 0, "-1", "false"},
                                    {18, 18, "7E-18", 38, 0, "0", "false"},
                                    {18, 18, "-0.601576632027484965", 38, 0, "-1", "false"},
                                    {18, 18, "0.130845800425806082", 38, 0, "0", "false"},
                                    {18, 18, "-0.999999838751720432", 38, 0, "-1", "false"},
                                    {18, 18, "-0.999999986527567357", 38, 0, "-1", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s18ToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {{18, 18, "0.217315146724293825", 38, 2, "0.22", "false"},
                                    {18, 18, "-0.684300205987062176", 38, 2, "-0.68", "false"},
                                    {18, 18, "0.375420118316658430", 38, 2, "0.38", "false"},
                                    {18, 18, "-0.661388577383460312", 38, 2, "-0.66", "false"},
                                    {18, 18, "4.2822E-14", 38, 2, "0", "false"},
                                    {18, 18, "-0.999999999935759151", 38, 2, "-1", "false"},
                                    {18, 18, "-0.383790443549735068", 38, 2, "-0.38", "false"},
                                    {18, 18, "0.192146046501021801", 38, 2, "0.19", "false"},
                                    {18, 18, "0.966084983255903108", 38, 2, "0.97", "false"},
                                    {18, 18, "-0.999999999999999896", 38, 2, "-1", "false"},
                                    {18, 18, "0.066378576854826434", 38, 2, "0.07", "false"},
                                    {18, 18, "-0.764301365968313333", 38, 2, "-0.76", "false"},
                                    {18, 18, "0.189502075280017227", 38, 2, "0.19", "false"},
                                    {18, 18, "6.7058E-14", 38, 2, "0", "false"},
                                    {18, 18, "-0.999999262632838512", 38, 2, "-1", "false"},
                                    {18, 18, "0.117194731449050112", 38, 2, "0.12", "false"},
                                    {18, 18, "-0.397789229055636812", 38, 2, "-0.40", "false"},
                                    {18, 18, "0.683579776199756688", 38, 2, "0.68", "false"},
                                    {18, 18, "-0.868047864174432132", 38, 2, "-0.87", "false"},
                                    {18, 18, "0.000056773317003915", 38, 2, "0", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s18ToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {{18, 18, "-0.250524249437775142", 38, 9, "-0.250524249", "false"},
                                    {18, 18, "0.875627927683343283", 38, 9, "0.875627928", "false"},
                                    {18, 18, "0.322580236259201664", 38, 9, "0.322580236", "false"},
                                    {18, 18, "-0.999999999999999994", 38, 9, "-1", "false"},
                                    {18, 18, "-0.948962700096376118", 38, 9, "-0.948962700", "false"},
                                    {18, 18, "0.604171200968081888", 38, 9, "0.604171201", "false"},
                                    {18, 18, "4.43E-16", 38, 9, "0", "false"},
                                    {18, 18, "-0.153273452470474396", 38, 9, "-0.153273452", "false"},
                                    {18, 18, "0.801076500507892070", 38, 9, "0.801076501", "false"},
                                    {18, 18, "0.043285053809935008", 38, 9, "0.043285054", "false"},
                                    {18, 18, "0.165744026051078191", 38, 9, "0.165744026", "false"},
                                    {18, 18, "-0.683496635243422118", 38, 9, "-0.683496635", "false"},
                                    {18, 18, "-0.999979692982159394", 38, 9, "-0.999979693", "false"},
                                    {18, 18, "0.005596709285154296", 38, 9, "0.005596709", "false"},
                                    {18, 18, "0.690630997434497775", 38, 9, "0.690630997", "false"},
                                    {18, 18, "0.652656610183150851", 38, 9, "0.652656610", "false"},
                                    {18, 18, "-0.999997086608116963", 38, 9, "-0.999997087", "false"},
                                    {18, 18, "-0.032421535352866518", 38, 9, "-0.032421535", "false"},
                                    {18, 18, "0.208086528054042571", 38, 9, "0.208086528", "false"},
                                    {18, 18, "0.476877541585567394", 38, 9, "0.476877542", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s18ToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {{18, 18, "-0.999999998612670738", 38, 13, "-0.9999999986127", "false"},
                                    {18, 18, "-0.999999456562223855", 38, 13, "-0.9999994565622", "false"},
                                    {18, 18, "0.778966623595598331", 38, 13, "0.7789666235956", "false"},
                                    {18, 18, "0.713566225594375697", 38, 13, "0.7135662255944", "false"},
                                    {18, 18, "2.895765518E-9", 38, 13, "0.0000000028958", "false"},
                                    {18, 18, "-0.750179762851382813", 38, 13, "-0.7501797628514", "false"},
                                    {18, 18, "-0.999995158459012317", 38, 13, "-0.9999951584590", "false"},
                                    {18, 18, "0.003503582802973417", 38, 13, "0.0035035828030", "false"},
                                    {18, 18, "0.000065592525584649", 38, 13, "0.0000655925256", "false"},
                                    {18, 18, "7.1487147E-11", 38, 13, "0.0000000000715", "false"},
                                    {18, 18, "1E-18", 38, 13, "0", "false"},
                                    {18, 18, "0.192397167444914633", 38, 13, "0.1923971674449", "false"},
                                    {18, 18, "0.575650079606370242", 38, 13, "0.5756500796064", "false"},
                                    {18, 18, "1.0E-17", 38, 13, "0", "false"},
                                    {18, 18, "0.924705464971801836", 38, 13, "0.9247054649718", "false"},
                                    {18, 18, "-0.682872913914359924", 38, 13, "-0.6828729139144", "false"},
                                    {18, 18, "0.737034462511017935", 38, 13, "0.7370344625110", "false"},
                                    {18, 18, "0.127232793941641682", 38, 13, "0.1272327939416", "false"},
                                    {18, 18, "-0.670250530403889111", 38, 13, "-0.6702505304039", "false"},
                                    {18, 18, "0.049076800953522212", 38, 13, "0.0490768009535", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s18ToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {{18, 18, "-0.102336771436052668", 38, 18, "-0.102336771436052668", "false"},
                                    {18, 18, "0.760080142692010881", 38, 18, "0.760080142692010881", "false"},
                                    {18, 18, "0.002198185086981905", 38, 18, "0.002198185086981905", "false"},
                                    {18, 18, "0E-18", 38, 18, "0", "false"},
                                    {18, 18, "-0.380074851643110668", 38, 18, "-0.380074851643110668", "false"},
                                    {18, 18, "4.50E-16", 38, 18, "0.000000000000000450", "false"},
                                    {18, 18, "-0.458792128601365483", 38, 18, "-0.458792128601365483", "false"},
                                    {18, 18, "-0.999862760603576027", 38, 18, "-0.999862760603576027", "false"},
                                    {18, 18, "1.94458481563E-7", 38, 18, "0.000000194458481563", "false"},
                                    {18, 18, "6.2E-17", 38, 18, "0.000000000000000062", "false"},
                                    {18, 18, "1.547207319E-9", 38, 18, "0.000000001547207319", "false"},
                                    {18, 18, "-0.398508346628434555", 38, 18, "-0.398508346628434555", "false"},
                                    {18, 18, "-0.540942085825894570", 38, 18, "-0.540942085825894570", "false"},
                                    {18, 18, "-0.171512823646662370", 38, 18, "-0.171512823646662370", "false"},
                                    {18, 18, "0.959691558048685509", 38, 18, "0.959691558048685509", "false"},
                                    {18, 18, "0.324352690910505686", 38, 18, "0.324352690910505686", "false"},
                                    {18, 18, "-0.114392696117992306", 38, 18, "-0.114392696117992306", "false"},
                                    {18, 18, "1.58112E-13", 38, 18, "0.000000000000158112", "false"},
                                    {18, 18, "-0.791099393610091228", 38, 18, "-0.791099393610091228", "false"},
                                    {18, 18, "-0.999999999700611396", 38, 18, "-0.999999999700611396", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p18s18ToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {
            {18, 18, "-0.921593930810107052", 35, 30, "-0.921593930810107052000000000000", "false"},
            {18, 18, "0.000003438195494776", 35, 30, "0.000003438195494776000000000000", "false"},
            {18, 18, "2.6266E-14", 35, 30, "0.000000000000026266000000000000", "false"},
            {18, 18, "1.57704E-13", 35, 30, "0.000000000000157704000000000000", "false"},
            {18, 18, "0.104128376264916076", 35, 30, "0.104128376264916076000000000000", "false"},
            {18, 18, "-0.999999999999999963", 35, 30, "-0.999999999999999963000000000000", "false"},
            {18, 18, "6.0532523776E-8", 35, 30, "0.000000060532523776000000000000", "false"},
            {18, 18, "0.414238718569409115", 35, 30, "0.414238718569409115000000000000", "false"},
            {18, 18, "-0.701450152540412489", 35, 30, "-0.701450152540412489000000000000", "false"},
            {18, 18, "-0.999766418575401625", 35, 30, "-0.999766418575401625000000000000", "false"},
            {18, 18, "0.000001362362927487", 35, 30, "0.000001362362927487000000000000", "false"},
            {18, 18, "-0.594755455426265737", 35, 30, "-0.594755455426265737000000000000", "false"},
            {18, 18, "-0.999999999340561599", 35, 30, "-0.999999999340561599000000000000", "false"},
            {18, 18, "0.000014472902296476", 35, 30, "0.000014472902296476000000000000", "false"},
            {18, 18, "0.223979426090166542", 35, 30, "0.223979426090166542000000000000", "false"},
            {18, 18, "-0.578888322749146924", 35, 30, "-0.578888322749146924000000000000", "false"},
            {18, 18, "-0.622107579535012436", 35, 30, "-0.622107579535012436000000000000", "false"},
            {18, 18, "-0.226400999666222553", 35, 30, "-0.226400999666222553000000000000", "false"},
            {18, 18, "-0.501458216739667890", 35, 30, "-0.501458216739667890000000000000", "false"},
            {18, 18, "-0.894817247905870006", 35, 30, "-0.894817247905870006000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{15, 13, "2.1139925962205", 9, 0, "2", "false"},
                                    {15, 13, "92.0295790550178", 9, 0, "92", "false"},
                                    {15, 13, "38.9956830145332", 9, 0, "39", "false"},
                                    {15, 13, "-97.3373210117955", 9, 0, "-97", "false"},
                                    {15, 13, "-28.9608424594621", 9, 0, "-29", "false"},
                                    {15, 13, "64.1029480700266", 9, 0, "64", "false"},
                                    {15, 13, "1.1E-12", 9, 0, "0", "false"},
                                    {15, 13, "-99.9999999420849", 9, 0, "-100", "false"},
                                    {15, 13, "24.8384934262315", 9, 0, "25", "false"},
                                    {15, 13, "44.3151267540068", 9, 0, "44", "false"},
                                    {15, 13, "-46.3284996324653", 9, 0, "-46", "false"},
                                    {15, 13, "13.9000436835707", 9, 0, "14", "false"},
                                    {15, 13, "5.676E-10", 9, 0, "0", "false"},
                                    {15, 13, "0.6890611164029", 9, 0, "1", "false"},
                                    {15, 13, "-99.9999999999789", 9, 0, "-100", "false"},
                                    {15, 13, "-19.8676145401745", 9, 0, "-20", "false"},
                                    {15, 13, "0.0002239879535", 9, 0, "0", "false"},
                                    {15, 13, "19.4574619178952", 9, 0, "19", "false"},
                                    {15, 13, "0.0002742602289", 9, 0, "0", "false"},
                                    {15, 13, "-44.5705016937920", 9, 0, "-45", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {{15, 13, "-99.8527855869509", 9, 2, "-99.85", "false"},
                                    {15, 13, "1E-13", 9, 2, "0", "false"},
                                    {15, 13, "-99.9999999979367", 9, 2, "-100", "false"},
                                    {15, 13, "73.4334561696447", 9, 2, "73.43", "false"},
                                    {15, 13, "-35.5704234706181", 9, 2, "-35.57", "false"},
                                    {15, 13, "2.848810E-7", 9, 2, "0", "false"},
                                    {15, 13, "-24.2894161855181", 9, 2, "-24.29", "false"},
                                    {15, 13, "-97.6370750732711", 9, 2, "-97.64", "false"},
                                    {15, 13, "-19.3991387988923", 9, 2, "-19.40", "false"},
                                    {15, 13, "-30.7977023501083", 9, 2, "-30.80", "false"},
                                    {15, 13, "-99.9793241750666", 9, 2, "-99.98", "false"},
                                    {15, 13, "-89.3167646606101", 9, 2, "-89.32", "false"},
                                    {15, 13, "-3.9289138177866", 9, 2, "-3.93", "false"},
                                    {15, 13, "0.0027465948913", 9, 2, "0", "false"},
                                    {15, 13, "-93.7615991045888", 9, 2, "-93.76", "false"},
                                    {15, 13, "17.4046451251160", 9, 2, "17.40", "false"},
                                    {15, 13, "43.7649924157422", 9, 2, "43.76", "false"},
                                    {15, 13, "29.6754285916017", 9, 2, "29.68", "false"},
                                    {15, 13, "34.3046524875074", 9, 2, "34.30", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {
            {15, 13, "-29.6754498094946", 9, 9, "", "true"}, {15, 13, "24.8807173140604", 9, 9, "", "true"},
            {15, 13, "12.3892989634508", 9, 9, "", "true"},  {15, 13, "15.0372456425724", 9, 9, "", "true"},
            {15, 13, "-95.4939339245329", 9, 9, "", "true"}, {15, 13, "-39.8175484744680", 9, 9, "", "true"},
            {15, 13, "99.2164528104902", 9, 9, "", "true"},  {15, 13, "-99.1334891756517", 9, 9, "", "true"},
            {15, 13, "-99.9999999999956", 9, 9, "", "true"}, {15, 13, "-31.7772219761756", 9, 9, "", "true"},
            {15, 13, "-45.7103491017537", 9, 9, "", "true"}, {15, 13, "77.9648428955062", 9, 9, "", "true"},
            {15, 13, "-99.9999997999803", 9, 9, "", "true"}, {15, 13, "4.9225226160924", 9, 9, "", "true"},
            {15, 13, "-82.5669357061307", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal32p9s9Normal) {
    CastTestCaseArray test_cases = {{15, 13, "0.0000974026203", 9, 9, "0.000097403", "false"},
                                    {15, 13, "2.11692E-8", 9, 9, "0.000000021", "false"},
                                    {15, 13, "-1.3506794794540", 9, 9, "-1.350679479", "false"},
                                    {15, 13, "2E-13", 9, 9, "0", "false"},
                                    {15, 13, "0.0054795375751", 9, 9, "0.005479538", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal32p7s4Normal) {
    CastTestCaseArray test_cases = {{15, 13, "-99.9999999994812", 7, 4, "-100", "false"},
                                    {15, 13, "0.0002168899928", 7, 4, "0.0002", "false"},
                                    {15, 13, "6.7089290419899", 7, 4, "6.7089", "false"},
                                    {15, 13, "3.4926489262539", 7, 4, "3.4926", "false"},
                                    {15, 13, "-98.2509574514655", 7, 4, "-98.2510", "false"},
                                    {15, 13, "-99.9999999978601", 7, 4, "-100", "false"},
                                    {15, 13, "-34.8537878933516", 7, 4, "-34.8538", "false"},
                                    {15, 13, "90.0786627792222", 7, 4, "90.0787", "false"},
                                    {15, 13, "-40.2854667819816", 7, 4, "-40.2855", "false"},
                                    {15, 13, "44.2233323258804", 7, 4, "44.2233", "false"},
                                    {15, 13, "84.8945982213664", 7, 4, "84.8946", "false"},
                                    {15, 13, "1E-13", 7, 4, "0", "false"},
                                    {15, 13, "0.3857403620890", 7, 4, "0.3857", "false"},
                                    {15, 13, "-96.3038529185966", 7, 4, "-96.3039", "false"},
                                    {15, 13, "-66.2240254610494", 7, 4, "-66.2240", "false"},
                                    {15, 13, "-92.7397370316432", 7, 4, "-92.7397", "false"},
                                    {15, 13, "54.7057341724026", 7, 4, "54.7057", "false"},
                                    {15, 13, "-82.0170063495623", 7, 4, "-82.0170", "false"},
                                    {15, 13, "0.0000959586037", 7, 4, "0.0001", "false"},
                                    {15, 13, "-22.2626935371467", 7, 4, "-22.2627", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {{15, 13, "0.0000077544839", 18, 0, "0", "false"},
                                    {15, 13, "-99.9999999867583", 18, 0, "-100", "false"},
                                    {15, 13, "-99.9999999984479", 18, 0, "-100", "false"},
                                    {15, 13, "-9.5553888425900", 18, 0, "-10", "false"},
                                    {15, 13, "3.91E-11", 18, 0, "0", "false"},
                                    {15, 13, "-80.0058639036519", 18, 0, "-80", "false"},
                                    {15, 13, "-99.9997589517167", 18, 0, "-100", "false"},
                                    {15, 13, "-64.9609127034859", 18, 0, "-65", "false"},
                                    {15, 13, "-70.9400905142251", 18, 0, "-71", "false"},
                                    {15, 13, "-99.9999999994715", 18, 0, "-100", "false"},
                                    {15, 13, "77.4506248259264", 18, 0, "77", "false"},
                                    {15, 13, "1.0691875399755", 18, 0, "1", "false"},
                                    {15, 13, "-26.6308496767719", 18, 0, "-27", "false"},
                                    {15, 13, "-99.9998984072921", 18, 0, "-100", "false"},
                                    {15, 13, "52.6710018606060", 18, 0, "53", "false"},
                                    {15, 13, "-28.1907126384929", 18, 0, "-28", "false"},
                                    {15, 13, "32.2752957819976", 18, 0, "32", "false"},
                                    {15, 13, "-70.8127800807645", 18, 0, "-71", "false"},
                                    {15, 13, "60.4468532553591", 18, 0, "60", "false"},
                                    {15, 13, "-2.0353921266293", 18, 0, "-2", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {{15, 13, "66.3192348478986", 18, 2, "66.32", "false"},
                                    {15, 13, "83.0826617105447", 18, 2, "83.08", "false"},
                                    {15, 13, "0.0000442353979", 18, 2, "0", "false"},
                                    {15, 13, "-56.4503519311250", 18, 2, "-56.45", "false"},
                                    {15, 13, "-99.9999999999928", 18, 2, "-100", "false"},
                                    {15, 13, "1.186E-10", 18, 2, "0", "false"},
                                    {15, 13, "10.1256334121052", 18, 2, "10.13", "false"},
                                    {15, 13, "8.1228389260495", 18, 2, "8.12", "false"},
                                    {15, 13, "-47.0910884683647", 18, 2, "-47.09", "false"},
                                    {15, 13, "-81.0449530201002", 18, 2, "-81.04", "false"},
                                    {15, 13, "-56.0727590166041", 18, 2, "-56.07", "false"},
                                    {15, 13, "96.9073085477190", 18, 2, "96.91", "false"},
                                    {15, 13, "57.7500264742491", 18, 2, "57.75", "false"},
                                    {15, 13, "0.0000164389673", 18, 2, "0", "false"},
                                    {15, 13, "19.7156644960907", 18, 2, "19.72", "false"},
                                    {15, 13, "-23.5814714021401", 18, 2, "-23.58", "false"},
                                    {15, 13, "-98.4182542551362", 18, 2, "-98.42", "false"},
                                    {15, 13, "-99.9903737714609", 18, 2, "-99.99", "false"},
                                    {15, 13, "-99.9999814079863", 18, 2, "-100", "false"},
                                    {15, 13, "-99.9495094822552", 18, 2, "-99.95", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {{15, 13, "-59.5284119439449", 18, 9, "-59.528411944", "false"},
                                    {15, 13, "-5.4691878151163", 18, 9, "-5.469187815", "false"},
                                    {15, 13, "35.5730285669906", 18, 9, "35.573028567", "false"},
                                    {15, 13, "0.0013809980988", 18, 9, "0.001380998", "false"},
                                    {15, 13, "63.0333148592366", 18, 9, "63.033314859", "false"},
                                    {15, 13, "1.2E-12", 18, 9, "0", "false"},
                                    {15, 13, "87.2087537633815", 18, 9, "87.208753763", "false"},
                                    {15, 13, "-99.9999923256970", 18, 9, "-99.999992326", "false"},
                                    {15, 13, "84.2783068610161", 18, 9, "84.278306861", "false"},
                                    {15, 13, "1E-13", 18, 9, "0", "false"},
                                    {15, 13, "-47.3385125405368", 18, 9, "-47.338512541", "false"},
                                    {15, 13, "-99.9999878297714", 18, 9, "-99.999987830", "false"},
                                    {15, 13, "1.2426282761376", 18, 9, "1.242628276", "false"},
                                    {15, 13, "14.4364516937015", 18, 9, "14.436451694", "false"},
                                    {15, 13, "3.611E-10", 18, 9, "0", "false"},
                                    {15, 13, "-25.5434377670815", 18, 9, "-25.543437767", "false"},
                                    {15, 13, "89.4323900808474", 18, 9, "89.432390081", "false"},
                                    {15, 13, "-99.9998304755443", 18, 9, "-99.999830476", "false"},
                                    {15, 13, "-14.3491982155616", 18, 9, "-14.349198216", "false"},
                                    {15, 13, "-99.9999999999954", 18, 9, "-100", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {
            {15, 13, "22.1055878087621", 18, 18, "", "true"},  {15, 13, "48.6697019084322", 18, 18, "", "true"},
            {15, 13, "45.6222128981277", 18, 18, "", "true"},  {15, 13, "29.1300977273218", 18, 18, "", "true"},
            {15, 13, "44.2391028148679", 18, 18, "", "true"},  {15, 13, "-99.9999999985325", 18, 18, "", "true"},
            {15, 13, "-19.6150185069177", 18, 18, "", "true"}, {15, 13, "29.5011052769498", 18, 18, "", "true"},
            {15, 13, "-88.1973737683613", 18, 18, "", "true"}, {15, 13, "97.2828671435224", 18, 18, "", "true"},
            {15, 13, "11.7195340923777", 18, 18, "", "true"},  {15, 13, "-42.9954790774910", 18, 18, "", "true"},
            {15, 13, "76.0181330362413", 18, 18, "", "true"},  {15, 13, "-22.6579013138431", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal64p18s18Normal) {
    CastTestCaseArray test_cases = {{15, 13, "9.2016221956360", 18, 18, "9.201622195636000000", "false"},
                                    {15, 13, "4.31353E-8", 18, 18, "0.000000043135300000", "false"},
                                    {15, 13, "1.2E-12", 18, 18, "0.000000000001200000", "false"},
                                    {15, 13, "9.5E-12", 18, 18, "0.000000000009500000", "false"},
                                    {15, 13, "0.0846784016385", 18, 18, "0.084678401638500000", "false"},
                                    {15, 13, "1.22E-11", 18, 18, "0.000000000012200000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{15, 13, "-99.9995922747401", 15, 13, "-99.9995922747401", "false"},
                                    {15, 13, "-99.9999963394988", 15, 13, "-99.9999963394988", "false"},
                                    {15, 13, "88.9516925827528", 15, 13, "88.9516925827528", "false"},
                                    {15, 13, "12.7924918094897", 15, 13, "12.7924918094897", "false"},
                                    {15, 13, "70.4816222352550", 15, 13, "70.4816222352550", "false"},
                                    {15, 13, "-31.1111828023281", 15, 13, "-31.1111828023281", "false"},
                                    {15, 13, "-27.1748675518255", 15, 13, "-27.1748675518255", "false"},
                                    {15, 13, "0.0001184813917", 15, 13, "0.0001184813917", "false"},
                                    {15, 13, "8.4773831029973", 15, 13, "8.4773831029973", "false"},
                                    {15, 13, "-79.6510115714512", 15, 13, "-79.6510115714512", "false"},
                                    {15, 13, "76.4185285978597", 15, 13, "76.4185285978597", "false"},
                                    {15, 13, "39.1683808765970", 15, 13, "39.1683808765970", "false"},
                                    {15, 13, "72.7346237522216", 15, 13, "72.7346237522216", "false"},
                                    {15, 13, "44.9202047050305", 15, 13, "44.9202047050305", "false"},
                                    {15, 13, "1.5959734629924", 15, 13, "1.5959734629924", "false"},
                                    {15, 13, "-99.9749873005530", 15, 13, "-99.9749873005530", "false"},
                                    {15, 13, "1.9039E-9", 15, 13, "0.0000000019039", "false"},
                                    {15, 13, "87.1545016495388", 15, 13, "87.1545016495388", "false"},
                                    {15, 13, "-97.4610615490981", 15, 13, "-97.4610615490981", "false"},
                                    {15, 13, "15.7010376990642", 15, 13, "15.7010376990642", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {{15, 13, "-61.8759640353306", 38, 0, "-62", "false"},
                                    {15, 13, "-99.9999997504692", 38, 0, "-100", "false"},
                                    {15, 13, "65.1161147020602", 38, 0, "65", "false"},
                                    {15, 13, "-84.3909309416376", 38, 0, "-84", "false"},
                                    {15, 13, "-99.9763709667561", 38, 0, "-100", "false"},
                                    {15, 13, "-99.9999999996813", 38, 0, "-100", "false"},
                                    {15, 13, "61.4327433157864", 38, 0, "61", "false"},
                                    {15, 13, "-99.9999999776951", 38, 0, "-100", "false"},
                                    {15, 13, "-99.9999999083658", 38, 0, "-100", "false"},
                                    {15, 13, "50.6022596105644", 38, 0, "51", "false"},
                                    {15, 13, "-3.4837011062788", 38, 0, "-3", "false"},
                                    {15, 13, "-99.1243213813674", 38, 0, "-99", "false"},
                                    {15, 13, "-60.0841181268718", 38, 0, "-60", "false"},
                                    {15, 13, "-62.2203865141968", 38, 0, "-62", "false"},
                                    {15, 13, "-80.0099855742827", 38, 0, "-80", "false"},
                                    {15, 13, "53.9219797188151", 38, 0, "54", "false"},
                                    {15, 13, "-99.9999944588125", 38, 0, "-100", "false"},
                                    {15, 13, "-48.1061001611781", 38, 0, "-48", "false"},
                                    {15, 13, "53.4689690259497", 38, 0, "53", "false"},
                                    {15, 13, "-36.7760961015488", 38, 0, "-37", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {{15, 13, "-11.5349184645362", 38, 2, "-11.53", "false"},
                                    {15, 13, "7.13E-11", 38, 2, "0", "false"},
                                    {15, 13, "0E-13", 38, 2, "0", "false"},
                                    {15, 13, "76.4277116685176", 38, 2, "76.43", "false"},
                                    {15, 13, "20.8809249704338", 38, 2, "20.88", "false"},
                                    {15, 13, "-4.0948455171571", 38, 2, "-4.09", "false"},
                                    {15, 13, "-57.5613920513470", 38, 2, "-57.56", "false"},
                                    {15, 13, "-87.3130190247040", 38, 2, "-87.31", "false"},
                                    {15, 13, "-99.9999999995963", 38, 2, "-100", "false"},
                                    {15, 13, "72.6115405056679", 38, 2, "72.61", "false"},
                                    {15, 13, "0.5299146229864", 38, 2, "0.53", "false"},
                                    {15, 13, "-60.1925445406678", 38, 2, "-60.19", "false"},
                                    {15, 13, "-99.9999999999648", 38, 2, "-100", "false"},
                                    {15, 13, "-66.5654607578395", 38, 2, "-66.57", "false"},
                                    {15, 13, "50.3257860752070", 38, 2, "50.33", "false"},
                                    {15, 13, "32.8509622672739", 38, 2, "32.85", "false"},
                                    {15, 13, "6.996899E-7", 38, 2, "0", "false"},
                                    {15, 13, "1.2759E-9", 38, 2, "0", "false"},
                                    {15, 13, "-99.9999999988899", 38, 2, "-100", "false"},
                                    {15, 13, "-99.7470958645543", 38, 2, "-99.75", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {{15, 13, "59.6883363328679", 38, 9, "59.688336333", "false"},
                                    {15, 13, "9E-13", 38, 9, "0", "false"},
                                    {15, 13, "0.1338243762830", 38, 9, "0.133824376", "false"},
                                    {15, 13, "25.5350236899030", 38, 9, "25.535023690", "false"},
                                    {15, 13, "-63.7731480291676", 38, 9, "-63.773148029", "false"},
                                    {15, 13, "-99.9999998447472", 38, 9, "-99.999999845", "false"},
                                    {15, 13, "-84.3309282616730", 38, 9, "-84.330928262", "false"},
                                    {15, 13, "-66.1874574520703", 38, 9, "-66.187457452", "false"},
                                    {15, 13, "2.7912E-9", 38, 9, "0.000000003", "false"},
                                    {15, 13, "-99.9999999999992", 38, 9, "-100", "false"},
                                    {15, 13, "-99.9999999434342", 38, 9, "-99.999999943", "false"},
                                    {15, 13, "-99.9999999998547", 38, 9, "-100", "false"},
                                    {15, 13, "45.0080743807579", 38, 9, "45.008074381", "false"},
                                    {15, 13, "-99.9999999993281", 38, 9, "-99.999999999", "false"},
                                    {15, 13, "-47.6828471660447", 38, 9, "-47.682847166", "false"},
                                    {15, 13, "-97.3707086040948", 38, 9, "-97.370708604", "false"},
                                    {15, 13, "-83.5770897776343", 38, 9, "-83.577089778", "false"},
                                    {15, 13, "15.5088661750147", 38, 9, "15.508866175", "false"},
                                    {15, 13, "10.9521940492109", 38, 9, "10.952194049", "false"},
                                    {15, 13, "-92.8508690358281", 38, 9, "-92.850869036", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {{15, 13, "9.8558E-9", 38, 13, "0.0000000098558", "false"},
                                    {15, 13, "-99.9944467435413", 38, 13, "-99.9944467435413", "false"},
                                    {15, 13, "-27.4816602862549", 38, 13, "-27.4816602862549", "false"},
                                    {15, 13, "73.8817695560705", 38, 13, "73.8817695560705", "false"},
                                    {15, 13, "40.6061453515437", 38, 13, "40.6061453515437", "false"},
                                    {15, 13, "-99.7029273606516", 38, 13, "-99.7029273606516", "false"},
                                    {15, 13, "1.01278E-8", 38, 13, "0.0000000101278", "false"},
                                    {15, 13, "35.1599979835829", 38, 13, "35.1599979835829", "false"},
                                    {15, 13, "-85.0393040656662", 38, 13, "-85.0393040656662", "false"},
                                    {15, 13, "-99.9999999999987", 38, 13, "-99.9999999999987", "false"},
                                    {15, 13, "28.9052343705935", 38, 13, "28.9052343705935", "false"},
                                    {15, 13, "-51.1282223842884", 38, 13, "-51.1282223842884", "false"},
                                    {15, 13, "53.2454773157217", 38, 13, "53.2454773157217", "false"},
                                    {15, 13, "-11.5516365512487", 38, 13, "-11.5516365512487", "false"},
                                    {15, 13, "-99.9999861800966", 38, 13, "-99.9999861800966", "false"},
                                    {15, 13, "15.2129717927527", 38, 13, "15.2129717927527", "false"},
                                    {15, 13, "-99.9999527691797", 38, 13, "-99.9999527691797", "false"},
                                    {15, 13, "-9.7959300719248", 38, 13, "-9.7959300719248", "false"},
                                    {15, 13, "-99.9999999830281", 38, 13, "-99.9999999830281", "false"},
                                    {15, 13, "44.1745407997069", 38, 13, "44.1745407997069", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {{15, 13, "-36.9556178267293", 38, 18, "-36.955617826729300000", "false"},
                                    {15, 13, "1.56775E-8", 38, 18, "0.000000015677500000", "false"},
                                    {15, 13, "6.1403786918362", 38, 18, "6.140378691836200000", "false"},
                                    {15, 13, "-26.1688930709718", 38, 18, "-26.168893070971800000", "false"},
                                    {15, 13, "19.8481441377330", 38, 18, "19.848144137733000000", "false"},
                                    {15, 13, "-99.9999941240434", 38, 18, "-99.999994124043400000", "false"},
                                    {15, 13, "-20.5358903390603", 38, 18, "-20.535890339060300000", "false"},
                                    {15, 13, "5.134E-10", 38, 18, "0.000000000513400000", "false"},
                                    {15, 13, "30.2884179904108", 38, 18, "30.288417990410800000", "false"},
                                    {15, 13, "-99.9999999967454", 38, 18, "-99.999999996745400000", "false"},
                                    {15, 13, "0.0445995216532", 38, 18, "0.044599521653200000", "false"},
                                    {15, 13, "51.2841055066498", 38, 18, "51.284105506649800000", "false"},
                                    {15, 13, "22.8879720875297", 38, 18, "22.887972087529700000", "false"},
                                    {15, 13, "-99.5025854956596", 38, 18, "-99.502585495659600000", "false"},
                                    {15, 13, "-66.7550979730381", 38, 18, "-66.755097973038100000", "false"},
                                    {15, 13, "76.4185285978597", 38, 18, "76.418528597859700000", "false"},
                                    {15, 13, "90.0009965943939", 38, 18, "90.000996594393900000", "false"},
                                    {15, 13, "6.80687E-8", 38, 18, "0.000000068068700000", "false"},
                                    {15, 13, "-8.3291082133668", 38, 18, "-8.329108213366800000", "false"},
                                    {15, 13, "0.0011906073610", 38, 18, "0.001190607361000000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal64p15s13ToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {
            {15, 13, "14.6331613273068", 35, 30, "14.633161327306800000000000000000", "false"},
            {15, 13, "-84.8938502800652", 35, 30, "-84.893850280065200000000000000000", "false"},
            {15, 13, "-99.9999999999986", 35, 30, "-99.999999999998600000000000000000", "false"},
            {15, 13, "-98.2251406085093", 35, 30, "-98.225140608509300000000000000000", "false"},
            {15, 13, "-25.4781520379902", 35, 30, "-25.478152037990200000000000000000", "false"},
            {15, 13, "28.0635209938264", 35, 30, "28.063520993826400000000000000000", "false"},
            {15, 13, "0.0101782758013", 35, 30, "0.010178275801300000000000000000", "false"},
            {15, 13, "71.4854720530088", 35, 30, "71.485472053008800000000000000000", "false"},
            {15, 13, "35.3886122044538", 35, 30, "35.388612204453800000000000000000", "false"},
            {15, 13, "53.9652943392137", 35, 30, "53.965294339213700000000000000000", "false"},
            {15, 13, "78.1261181116326", 35, 30, "78.126118111632600000000000000000", "false"},
            {15, 13, "0.0000173038475", 35, 30, "0.000017303847500000000000000000", "false"},
            {15, 13, "-99.9999999804697", 35, 30, "-99.999999980469700000000000000000", "false"},
            {15, 13, "84.3266994130632", 35, 30, "84.326699413063200000000000000000", "false"},
            {15, 13, "-6.8869327249129", 35, 30, "-6.886932724912900000000000000000", "false"},
            {15, 13, "0.0808008255318", 35, 30, "0.080800825531800000000000000000", "false"},
            {15, 13, "-25.4007916439478", 35, 30, "-25.400791643947800000000000000000", "false"},
            {15, 13, "44.0659452951955", 35, 30, "44.065945295195500000000000000000", "false"},
            {15, 13, "86.5006568416930", 35, 30, "86.500656841693000000000000000000", "false"},
            {15, 13, "-99.9999997176001", 35, 30, "-99.999999717600100000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL64, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal32p9s0Abnormal) {
    CastTestCaseArray test_cases = {{38, 0, "-99992180456685489733531558381017563646", 9, 0, "", "true"},
                                    {38, 0, "-99999999999998526256766569142661532024", 9, 0, "", "true"},
                                    {38, 0, "-64073282639970675005480712573572824802", 9, 0, "", "true"},
                                    {38, 0, "-99999999999999999999999999946653504429", 9, 0, "", "true"},
                                    {38, 0, "2106950073524", 9, 0, "", "true"},
                                    {38, 0, "5316058752158936", 9, 0, "", "true"},
                                    {38, 0, "-99999999999924039575859729986687062045", 9, 0, "", "true"},
                                    {38, 0, "550584102734634152", 9, 0, "", "true"},
                                    {38, 0, "-99999999999999999999999999983553242655", 9, 0, "", "true"},
                                    {38, 0, "-99999999999860309711998027396737632391", 9, 0, "", "true"},
                                    {38, 0, "-99999999999725387588765690654466403223", 9, 0, "", "true"},
                                    {38, 0, "-99999999999999999999999999999498437326", 9, 0, "", "true"},
                                    {38, 0, "-99999999999999999999988776382578040769", 9, 0, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999999922", 9, 0, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{38, 0, "0", 9, 0, "0", "false"},
                                    {38, 0, "31618617", 9, 0, "31618617", "false"},
                                    {38, 0, "433616920", 9, 0, "433616920", "false"},
                                    {38, 0, "34709", 9, 0, "34709", "false"},
                                    {38, 0, "140854645", 9, 0, "140854645", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal32p9s2Abnormal) {
    CastTestCaseArray test_cases = {{38, 0, "196695380510204456450", 9, 2, "", "true"},
                                    {38, 0, "-99999999999999999995565586842718089454", 9, 2, "", "true"},
                                    {38, 0, "430889223315", 9, 2, "", "true"},
                                    {38, 0, "-99999999999999999999999991658803837167", 9, 2, "", "true"},
                                    {38, 0, "-99963990476430210948616389494122130530", 9, 2, "", "true"},
                                    {38, 0, "17265079414407210915917153809484", 9, 2, "", "true"},
                                    {38, 0, "41334299747", 9, 2, "", "true"},
                                    {38, 0, "18343663319055374780260714", 9, 2, "", "true"},
                                    {38, 0, "17961834120943560228", 9, 2, "", "true"},
                                    {38, 0, "140857455119396989501627983340", 9, 2, "", "true"},
                                    {38, 0, "-99999999999999999999997828836554976392", 9, 2, "", "true"},
                                    {38, 0, "32329528495433885901437219417082204828", 9, 2, "", "true"},
                                    {38, 0, "-99999999999999999999754340384888868306", 9, 2, "", "true"},
                                    {38, 0, "-99982972968221329850723064850645611316", 9, 2, "", "true"},
                                    {38, 0, "-99999999999999999819554823846223726518", 9, 2, "", "true"},
                                    {38, 0, "-99999999999999999999989069469038809571", 9, 2, "", "true"},
                                    {38, 0, "3951609262800748939745915455472", 9, 2, "", "true"},
                                    {38, 0, "-99999999999999999942202136461112848149", 9, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {{38, 0, "1455", 9, 2, "1455", "false"}, {38, 0, "3", 9, 2, "3", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {{38, 0, "53964223", 9, 9, "", "true"},
                                    {38, 0, "2867912904897247308253992149", 9, 9, "", "true"},
                                    {38, 0, "8677451610", 9, 9, "", "true"},
                                    {38, 0, "479383602647779497", 9, 9, "", "true"},
                                    {38, 0, "1885319", 9, 9, "", "true"},
                                    {38, 0, "-99999999999999999410198905395407038211", 9, 9, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999975663", 9, 9, "", "true"},
                                    {38, 0, "9771935958651310351206", 9, 9, "", "true"},
                                    {38, 0, "1878", 9, 9, "", "true"},
                                    {38, 0, "5947179591316071461", 9, 9, "", "true"},
                                    {38, 0, "8229091770331951118280", 9, 9, "", "true"},
                                    {38, 0, "-99999999999999999239010105394359989015", 9, 9, "", "true"},
                                    {38, 0, "583204915", 9, 9, "", "true"},
                                    {38, 0, "-53303634864869017911235094211959312444", 9, 9, "", "true"},
                                    {38, 0, "272786832445985366", 9, 9, "", "true"},
                                    {38, 0, "23426018559572175783320862125892", 9, 9, "", "true"},
                                    {38, 0, "-99999999999999999650244926401330917095", 9, 9, "", "true"},
                                    {38, 0, "1137518475653271205892227094720856437", 9, 9, "", "true"},
                                    {38, 0, "-99999999999999999999999964935445589316", 9, 9, "", "true"},
                                    {38, 0, "-99999999999807201911533653729643009421", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal32p7s4Abnormal) {
    CastTestCaseArray test_cases = {{38, 0, "470488482989", 7, 4, "", "true"},
                                    {38, 0, "-99999999999999999999999998987088417251", 7, 4, "", "true"},
                                    {38, 0, "144694674128072894491435", 7, 4, "", "true"},
                                    {38, 0, "-99999999696471504111131314488058975047", 7, 4, "", "true"},
                                    {38, 0, "256144357973445003749319954", 7, 4, "", "true"},
                                    {38, 0, "-99999999928583866522628351358476493643", 7, 4, "", "true"},
                                    {38, 0, "-29858816539530768268312696284115894270", 7, 4, "", "true"},
                                    {38, 0, "-99999999999999997023155394824778766664", 7, 4, "", "true"},
                                    {38, 0, "-99999999999999999877127449026319819470", 7, 4, "", "true"},
                                    {38, 0, "75803660734236982153091666632620812", 7, 4, "", "true"},
                                    {38, 0, "-99999999999999999999676371192855859312", 7, 4, "", "true"},
                                    {38, 0, "56728314013702824617641416469378", 7, 4, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999999976", 7, 4, "", "true"},
                                    {38, 0, "-99999999999967687718754870367646627351", 7, 4, "", "true"},
                                    {38, 0, "504437270911", 7, 4, "", "true"},
                                    {38, 0, "280707204295850", 7, 4, "", "true"},
                                    {38, 0, "14291329628161177862838437085296", 7, 4, "", "true"},
                                    {38, 0, "-99999999999999926430926405108896818003", 7, 4, "", "true"},
                                    {38, 0, "-99999999999999999999999999999997753022", 7, 4, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal32p7s4Normal) {
    CastTestCaseArray test_cases = {{38, 0, "33876", 7, 4, "33876", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal64p18s0Abnormal) {
    CastTestCaseArray test_cases = {{38, 0, "41321970186127249654541234176", 18, 0, "", "true"},
                                    {38, 0, "-99999999999893221979243819378754334240", 18, 0, "", "true"},
                                    {38, 0, "-99999752570038806643544365652492769077", 18, 0, "", "true"},
                                    {38, 0, "11903206079539572757", 18, 0, "", "true"},
                                    {38, 0, "14424748256053010797927", 18, 0, "", "true"},
                                    {38, 0, "21666656208632801966209086794", 18, 0, "", "true"},
                                    {38, 0, "20264056429065309163893273839377890", 18, 0, "", "true"},
                                    {38, 0, "1392918709321053244577048939265135185", 18, 0, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999991894", 18, 0, "", "true"},
                                    {38, 0, "-99999999999999970474789680309089482402", 18, 0, "", "true"},
                                    {38, 0, "-99999999999999999999999999933744111559", 18, 0, "", "true"},
                                    {38, 0, "13683248512119360002606482583573066", 18, 0, "", "true"},
                                    {38, 0, "-99999999984336202109867172724032604242", 18, 0, "", "true"},
                                    {38, 0, "64155318329278739286559701", 18, 0, "", "true"},
                                    {38, 0, "132517756382519891234466229179", 18, 0, "", "true"},
                                    {38, 0, "11906463994200959282586393", 18, 0, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {{38, 0, "774981824", 18, 0, "774981824", "false"},
                                    {38, 0, "16868837824642", 18, 0, "16868837824642", "false"},
                                    {38, 0, "8317660091427", 18, 0, "8317660091427", "false"},
                                    {38, 0, "177285", 18, 0, "177285", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal64p18s2Abnormal) {
    CastTestCaseArray test_cases = {{38, 0, "3527640099869719165374794", 18, 2, "", "true"},
                                    {38, 0, "-97946315937988930891335168723691922541", 18, 2, "", "true"},
                                    {38, 0, "-99999619753449005145484198624327085446", 18, 2, "", "true"},
                                    {38, 0, "-99999997654057535147180718636168373570", 18, 2, "", "true"},
                                    {38, 0, "-99999999999999999999999471060492579405", 18, 2, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999992429", 18, 2, "", "true"},
                                    {38, 0, "-99999999999406840995635660416501305169", 18, 2, "", "true"},
                                    {38, 0, "-99999999999999999999969257150525282291", 18, 2, "", "true"},
                                    {38, 0, "-99999999999999999999999999704888197208", 18, 2, "", "true"},
                                    {38, 0, "16481032367058292145018280811343118997", 18, 2, "", "true"},
                                    {38, 0, "16180034357084066544045681", 18, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {{38, 0, "123286", 18, 2, "123286", "false"},
                                    {38, 0, "72106877916960", 18, 2, "72106877916960", "false"},
                                    {38, 0, "4346258434", 18, 2, "4346258434", "false"},
                                    {38, 0, "1", 18, 2, "1", "false"},
                                    {38, 0, "404", 18, 2, "404", "false"},
                                    {38, 0, "1003417668", 18, 2, "1003417668", "false"},
                                    {38, 0, "88174978", 18, 2, "88174978", "false"},
                                    {38, 0, "39876303087561", 18, 2, "39876303087561", "false"},
                                    {38, 0, "19627", 18, 2, "19627", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal64p18s9Abnormal) {
    CastTestCaseArray test_cases = {{38, 0, "-99999999942894171979502910117151566822", 18, 9, "", "true"},
                                    {38, 0, "78110909801028322282074", 18, 9, "", "true"},
                                    {38, 0, "-99999999999999901870213714269852072238", 18, 9, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999373862", 18, 9, "", "true"},
                                    {38, 0, "-99999999999999999999999999999991866467", 18, 9, "", "true"},
                                    {38, 0, "-98946470323884119834311564216261655943", 18, 9, "", "true"},
                                    {38, 0, "1929705748814029662", 18, 9, "", "true"},
                                    {38, 0, "-32730914783017552474024257922358574294", 18, 9, "", "true"},
                                    {38, 0, "-99999743064251732247449416330577093472", 18, 9, "", "true"},
                                    {38, 0, "157565781104726932449222770722", 18, 9, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999988797", 18, 9, "", "true"},
                                    {38, 0, "269193421165987", 18, 9, "", "true"},
                                    {38, 0, "22160714557997818", 18, 9, "", "true"},
                                    {38, 0, "10718109462355798", 18, 9, "", "true"},
                                    {38, 0, "210337370488391866496308789", 18, 9, "", "true"},
                                    {38, 0, "-99999999936393389588452864322605178607", 18, 9, "", "true"},
                                    {38, 0, "12223393348030", 18, 9, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999977794", 18, 9, "", "true"},
                                    {38, 0, "-99999999999999999998264399101546442715", 18, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {{38, 0, "3472140125", 18, 9, "3472140125", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {{38, 0, "-99999999999999999999999999999999495299", 18, 18, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999999997", 18, 18, "", "true"},
                                    {38, 0, "495130683880503078829363006653086", 18, 18, "", "true"},
                                    {38, 0, "14258984240", 18, 18, "", "true"},
                                    {38, 0, "-99999999999999999999999999998605301676", 18, 18, "", "true"},
                                    {38, 0, "-99474584835088908392928227985560575624", 18, 18, "", "true"},
                                    {38, 0, "-99999999999999995375220110977831262063", 18, 18, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999648772", 18, 18, "", "true"},
                                    {38, 0, "1535534109752977190355661910509669030", 18, 18, "", "true"},
                                    {38, 0, "3880534549101250089655148", 18, 18, "", "true"},
                                    {38, 0, "-99999999999988219334762330432374769221", 18, 18, "", "true"},
                                    {38, 0, "8856244816995588", 18, 18, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999998379", 18, 18, "", "true"},
                                    {38, 0, "3961029", 18, 18, "", "true"},
                                    {38, 0, "-29858816539530768268312696284115894270", 18, 18, "", "true"},
                                    {38, 0, "-99999999701174822100278508785909822655", 18, 18, "", "true"},
                                    {38, 0, "4835680555373368085752899799917377", 18, 18, "", "true"},
                                    {38, 0, "19088664657", 18, 18, "", "true"},
                                    {38, 0, "103", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal64p18s18Normal) {
    CastTestCaseArray test_cases = {{38, 0, "3", 18, 18, "3", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal64p15s13Abnormal) {
    CastTestCaseArray test_cases = {{38, 0, "-99999999999999974563744208598934295189", 15, 13, "", "true"},
                                    {38, 0, "-99999999999999999931602063300912379783", 15, 13, "", "true"},
                                    {38, 0, "-99999999999999999999999999914926811318", 15, 13, "", "true"},
                                    {38, 0, "-99999999999999999999967855938225759554", 15, 13, "", "true"},
                                    {38, 0, "3879834688433", 15, 13, "", "true"},
                                    {38, 0, "-98973677485953396385322332129438273707", 15, 13, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999999992", 15, 13, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999999924", 15, 13, "", "true"},
                                    {38, 0, "-99773759468652047528636833041122383513", 15, 13, "", "true"},
                                    {38, 0, "-99999999999999999999999999999818564440", 15, 13, "", "true"},
                                    {38, 0, "14231437978735274820353", 15, 13, "", "true"},
                                    {38, 0, "1674708670709579743", 15, 13, "", "true"},
                                    {38, 0, "-99999999206920611969746256416958286845", 15, 13, "", "true"},
                                    {38, 0, "-99999999999112602836674819336043543484", 15, 13, "", "true"},
                                    {38, 0, "-99999999999999998636985979750821344821", 15, 13, "", "true"},
                                    {38, 0, "313889141278448858442238", 15, 13, "", "true"},
                                    {38, 0, "5194748208", 15, 13, "", "true"},
                                    {38, 0, "40237782095511384", 15, 13, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{38, 0, "15095", 15, 13, "15095", "false"}, {38, 0, "20", 15, 13, "20", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {
            {38, 0, "-99999999999999999999999999999999999992", 38, 0, "-99999999999999999999999999999999999992",
             "false"},
            {38, 0, "21587486767785999874712872890413", 38, 0, "21587486767785999874712872890413", "false"},
            {38, 0, "-99999999999999999999995228232497996506", 38, 0, "-99999999999999999999995228232497996506",
             "false"},
            {38, 0, "-99999999999999999999999990162803055128", 38, 0, "-99999999999999999999999990162803055128",
             "false"},
            {38, 0, "242", 38, 0, "242", "false"},
            {38, 0, "-99999999999999999999999999999999999770", 38, 0, "-99999999999999999999999999999999999770",
             "false"},
            {38, 0, "849175", 38, 0, "849175", "false"},
            {38, 0, "-99999999999477120106889979822024713653", 38, 0, "-99999999999477120106889979822024713653",
             "false"},
            {38, 0, "237822833979", 38, 0, "237822833979", "false"},
            {38, 0, "-99997911769158783694540185395425949396", 38, 0, "-99997911769158783694540185395425949396",
             "false"},
            {38, 0, "3247592388", 38, 0, "3247592388", "false"},
            {38, 0, "281444103520444568129123624", 38, 0, "281444103520444568129123624", "false"},
            {38, 0, "322277929690836", 38, 0, "322277929690836", "false"},
            {38, 0, "856273281129952644526590", 38, 0, "856273281129952644526590", "false"},
            {38, 0, "16847600121027669", 38, 0, "16847600121027669", "false"},
            {38, 0, "542703729430627492589506104", 38, 0, "542703729430627492589506104", "false"},
            {38, 0, "-99999999999999999714865151593064217180", 38, 0, "-99999999999999999714865151593064217180",
             "false"},
            {38, 0, "378190944723360293840446905666", 38, 0, "378190944723360293840446905666", "false"},
            {38, 0, "2149849021331133713083", 38, 0, "2149849021331133713083", "false"},
            {38, 0, "-99999999999573752742253106672486341596", 38, 0, "-99999999999573752742253106672486341596",
             "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal128p38s2Abnormal) {
    CastTestCaseArray test_cases = {{38, 0, "-99846923796632254866647266680005256695", 38, 2, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999999993", 38, 2, "", "true"},
                                    {38, 0, "-99999999999999999999999918303618546076", 38, 2, "", "true"},
                                    {38, 0, "-99999999999999999999999999964475830134", 38, 2, "", "true"},
                                    {38, 0, "-99999999999999999999932440391299518140", 38, 2, "", "true"},
                                    {38, 0, "-99999999999999999999999999972708836924", 38, 2, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999999799", 38, 2, "", "true"},
                                    {38, 0, "-99999999999999999998677595005671640391", 38, 2, "", "true"},
                                    {38, 0, "-99999999999999999999999986930225137591", 38, 2, "", "true"},
                                    {38, 0, "-99999999999999999999999999999998376709", 38, 2, "", "true"},
                                    {38, 0, "-99999999999999999998290760704298138361", 38, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {
            {38, 0, "559790613880391037042287461742646", 38, 2, "559790613880391037042287461742646", "false"},
            {38, 0, "171493793679749977295248123489", 38, 2, "171493793679749977295248123489", "false"},
            {38, 0, "516935284323063873235128", 38, 2, "516935284323063873235128", "false"},
            {38, 0, "91886189", 38, 2, "91886189", "false"},
            {38, 0, "662563484753786550647578683538873035", 38, 2, "662563484753786550647578683538873035", "false"},
            {38, 0, "1776107145978183992115047632626", 38, 2, "1776107145978183992115047632626", "false"},
            {38, 0, "6838506", 38, 2, "6838506", "false"},
            {38, 0, "245314059851576", 38, 2, "245314059851576", "false"},
            {38, 0, "488004306", 38, 2, "488004306", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal128p38s9Abnormal) {
    CastTestCaseArray test_cases = {{38, 0, "27109729729188731336730917277297", 38, 9, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999515634", 38, 9, "", "true"},
                                    {38, 0, "-99999999999999992273371541964798783822", 38, 9, "", "true"},
                                    {38, 0, "-97957109817200389148062700319127708451", 38, 9, "", "true"},
                                    {38, 0, "-99999999999999999999995099577916455407", 38, 9, "", "true"},
                                    {38, 0, "2492864161848769272414176371300", 38, 9, "", "true"},
                                    {38, 0, "7633454161140243403939911315599", 38, 9, "", "true"},
                                    {38, 0, "-99999999999999271050392337075316041763", 38, 9, "", "true"},
                                    {38, 0, "-99999999999999999999999999604683255545", 38, 9, "", "true"},
                                    {38, 0, "-99999914021322221182027074550160042837", 38, 9, "", "true"},
                                    {38, 0, "-99999987828577450277907636985183251821", 38, 9, "", "true"},
                                    {38, 0, "-99999999999999999999996975966611677189", 38, 9, "", "true"},
                                    {38, 0, "-99999999999999999999999991500257759971", 38, 9, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999984901", 38, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {{38, 0, "232429", 38, 9, "232429", "false"},
                                    {38, 0, "452896", 38, 9, "452896", "false"},
                                    {38, 0, "1972691838773224520", 38, 9, "1972691838773224520", "false"},
                                    {38, 0, "132686930", 38, 9, "132686930", "false"},
                                    {38, 0, "0", 38, 9, "0", "false"},
                                    {38, 0, "567127", 38, 9, "567127", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal128p38s13Abnormal) {
    CastTestCaseArray test_cases = {{38, 0, "-99994299645014323531588255158129751530", 38, 13, "", "true"},
                                    {38, 0, "-99999999999999999727582333203458695810", 38, 13, "", "true"},
                                    {38, 0, "-99999999999999999999999999996799814094", 38, 13, "", "true"},
                                    {38, 0, "-98999258580337854492422282198066379423", 38, 13, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999999876", 38, 13, "", "true"},
                                    {38, 0, "-99999999999999999999999999204039229221", 38, 13, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999813110", 38, 13, "", "true"},
                                    {38, 0, "-99999999999999999999999993442700948498", 38, 13, "", "true"},
                                    {38, 0, "-99999999999999999999999998134219824043", 38, 13, "", "true"},
                                    {38, 0, "-99999855764985285038303716679586005652", 38, 13, "", "true"},
                                    {38, 0, "64764660911310320670448485828470", 38, 13, "", "true"},
                                    {38, 0, "-99999999999999999999892582802035576718", 38, 13, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {{38, 0, "33096770", 38, 13, "33096770", "false"},
                                    {38, 0, "4764", 38, 13, "4764", "false"},
                                    {38, 0, "537460639906630551531", 38, 13, "537460639906630551531", "false"},
                                    {38, 0, "9022698774909823443", 38, 13, "9022698774909823443", "false"},
                                    {38, 0, "34003", 38, 13, "34003", "false"},
                                    {38, 0, "387", 38, 13, "387", "false"},
                                    {38, 0, "786529324996472513844", 38, 13, "786529324996472513844", "false"},
                                    {38, 0, "8495316787773404388855", 38, 13, "8495316787773404388855", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal128p38s18Abnormal) {
    CastTestCaseArray test_cases = {{38, 0, "-95106546221793509006153329302482391828", 38, 18, "", "true"},
                                    {38, 0, "1547872891423665542148904", 38, 18, "", "true"},
                                    {38, 0, "-99999999999578379086530447202014811918", 38, 18, "", "true"},
                                    {38, 0, "-99999999999999999999999442122579847459", 38, 18, "", "true"},
                                    {38, 0, "70141183460469231731687303715884105728", 38, 18, "", "true"},
                                    {38, 0, "-99999999999999974655458671610036118074", 38, 18, "", "true"},
                                    {38, 0, "337056990391922370409208090840472771", 38, 18, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999648750", 38, 18, "", "true"},
                                    {38, 0, "89034618196277908517359796412547239195", 38, 18, "", "true"},
                                    {38, 0, "-99999999999999999999999995793600297647", 38, 18, "", "true"},
                                    {38, 0, "-99999999999999999999999999999999999993", 38, 18, "", "true"},
                                    {38, 0, "-99999999746645951718265585687052255884", 38, 18, "", "true"},
                                    {38, 0, "-99826805348543016027467038959691197622", 38, 18, "", "true"},
                                    {38, 0, "2214526560951012911972962", 38, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {{38, 0, "723", 38, 18, "723", "false"},
                                    {38, 0, "1", 38, 18, "1", "false"},
                                    {38, 0, "416", 38, 18, "416", "false"},
                                    {38, 0, "2517941", 38, 18, "2517941", "false"},
                                    {38, 0, "84770368613388708", 38, 18, "84770368613388708", "false"},
                                    {38, 0, "911", 38, 18, "911", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal128p35s30Abnormal) {
    CastTestCaseArray test_cases = {{38, 0, "-99999999999981632865712744939630505153", 35, 30, "", "true"},
                                    {38, 0, "-99412915730798584525903150884319208815", 35, 30, "", "true"},
                                    {38, 0, "-99999999999999999999894154206708968711", 35, 30, "", "true"},
                                    {38, 0, "2000991312949259078271977454", 35, 30, "", "true"},
                                    {38, 0, "1339547203904549288468080", 35, 30, "", "true"},
                                    {38, 0, "861274700296101002", 35, 30, "", "true"},
                                    {38, 0, "-99999999999999999999999999639093278900", 35, 30, "", "true"},
                                    {38, 0, "2619193016696307302187415842803541705", 35, 30, "", "true"},
                                    {38, 0, "53203425424550", 35, 30, "", "true"},
                                    {38, 0, "2842955736", 35, 30, "", "true"},
                                    {38, 0, "-99999999999999999999992846889360563190", 35, 30, "", "true"},
                                    {38, 0, "106358705795959809", 35, 30, "", "true"},
                                    {38, 0, "872960941446327", 35, 30, "", "true"},
                                    {38, 0, "152829423980053774744892227247930540", 35, 30, "", "true"},
                                    {38, 0, "38585632107254711088994758499371918", 35, 30, "", "true"},
                                    {38, 0, "-99999999999999999998780046523292034420", 35, 30, "", "true"},
                                    {38, 0, "-99999999999999999999955901109800532683", 35, 30, "", "true"},
                                    {38, 0, "127177772847149223", 35, 30, "", "true"},
                                    {38, 0, "37202321338091488441585021360414", 35, 30, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s0ToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {{38, 0, "15", 35, 30, "15", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal32p9s0Abnormal) {
    CastTestCaseArray test_cases = {{38, 2, "-999999999999999999999999999999999999.98", 9, 0, "", "true"},
                                    {38, 2, "172559220657295969617566336651855.47", 9, 0, "", "true"},
                                    {38, 2, "4513599865168568.40", 9, 0, "", "true"},
                                    {38, 2, "-999999704898237892220745176370588690.77", 9, 0, "", "true"},
                                    {38, 2, "-999999999999999999999955585970490866.66", 9, 0, "", "true"},
                                    {38, 2, "1387695447840.16", 9, 0, "", "true"},
                                    {38, 2, "-999999999996836580567130810378782350.92", 9, 0, "", "true"},
                                    {38, 2, "-999999999999999999999999987523388557.28", 9, 0, "", "true"},
                                    {38, 2, "-999999999923014889049809549984217597.78", 9, 0, "", "true"},
                                    {38, 2, "-999999999999999999999999990071982254.61", 9, 0, "", "true"},
                                    {38, 2, "45767243561445540696813555.83", 9, 0, "", "true"},
                                    {38, 2, "5572199540477134665436534718.93", 9, 0, "", "true"},
                                    {38, 2, "605311882416603604.52", 9, 0, "", "true"},
                                    {38, 2, "90058275280607781476565507.83", 9, 0, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{38, 2, "83178.08", 9, 0, "83178", "false"},
                                    {38, 2, "24.69", 9, 0, "25", "false"},
                                    {38, 2, "16157190.44", 9, 0, "16157190", "false"},
                                    {38, 2, "394.70", 9, 0, "395", "false"},
                                    {38, 2, "0.31", 9, 0, "0", "false"},
                                    {38, 2, "4.03", 9, 0, "4", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal32p9s2Abnormal) {
    CastTestCaseArray test_cases = {{38, 2, "-999996872315256554402058765995732137.12", 9, 2, "", "true"},
                                    {38, 2, "-999999999999999999999999999999992607.26", 9, 2, "", "true"},
                                    {38, 2, "262132672942398479.49", 9, 2, "", "true"},
                                    {38, 2, "-914283353960673844768986839414370370.22", 9, 2, "", "true"},
                                    {38, 2, "64970808231552849360220184138229409.95", 9, 2, "", "true"},
                                    {38, 2, "-999999950502210191456896184861910326.25", 9, 2, "", "true"},
                                    {38, 2, "-862565877168542005282279048435771644.79", 9, 2, "", "true"},
                                    {38, 2, "-999999999999999999923839573636378360.04", 9, 2, "", "true"},
                                    {38, 2, "-999999985912100930987918543906142823.43", 9, 2, "", "true"},
                                    {38, 2, "-999999999999999999999999999989458955.64", 9, 2, "", "true"},
                                    {38, 2, "-999999988021914060029590457181437045.42", 9, 2, "", "true"},
                                    {38, 2, "40292699616061700864899945894340.19", 9, 2, "", "true"},
                                    {38, 2, "745289847991409415917928.75", 9, 2, "", "true"},
                                    {38, 2, "770140352359884364559.60", 9, 2, "", "true"},
                                    {38, 2, "-999251211878139898387226158569813793.36", 9, 2, "", "true"},
                                    {38, 2, "24940896688804378910114212394.07", 9, 2, "", "true"},
                                    {38, 2, "37373308853001317978706624616905.47", 9, 2, "", "true"},
                                    {38, 2, "-999999588033711462978925809502366615.24", 9, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {{38, 2, "4880.82", 9, 2, "4880.82", "false"},
                                    {38, 2, "156596.52", 9, 2, "156596.52", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {{38, 2, "6733514218668421379350889385496431.46", 9, 9, "", "true"},
                                    {38, 2, "-999999999999999999999999994902225895.61", 9, 9, "", "true"},
                                    {38, 2, "8816389258922528736.22", 9, 9, "", "true"},
                                    {38, 2, "-999999999999999999999999999999999999.25", 9, 9, "", "true"},
                                    {38, 2, "214328505902278113906885923573108268.09", 9, 9, "", "true"},
                                    {38, 2, "445556593590547329581974940.25", 9, 9, "", "true"},
                                    {38, 2, "-999992966553755771964481675340293342.88", 9, 9, "", "true"},
                                    {38, 2, "-999999964577460061953468610128410535.09", 9, 9, "", "true"},
                                    {38, 2, "-999999999999999999794856170231857393.40", 9, 9, "", "true"},
                                    {38, 2, "-999999999999999999999999999999999999.95", 9, 9, "", "true"},
                                    {38, 2, "141365232.65", 9, 9, "", "true"},
                                    {38, 2, "162200381175337950130432307715001699.72", 9, 9, "", "true"},
                                    {38, 2, "37696400615669407971038307210661273.63", 9, 9, "", "true"},
                                    {38, 2, "1621997314143026047715036848135804.08", 9, 9, "", "true"},
                                    {38, 2, "30522366935281107227537978799382.39", 9, 9, "", "true"},
                                    {38, 2, "-999999999999999999999999999999999999.96", 9, 9, "", "true"},
                                    {38, 2, "-475001633402139466753398302479923050.13", 9, 9, "", "true"},
                                    {38, 2, "186423093536428.29", 9, 9, "", "true"},
                                    {38, 2, "-999999999999999999433376529505947028.60", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal32p9s9Normal) {
    CastTestCaseArray test_cases = {{38, 2, "0.02", 9, 9, "0.020000000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal32p7s4Abnormal) {
    CastTestCaseArray test_cases = {{38, 2, "7232817721866456151534294766.88", 7, 4, "", "true"},
                                    {38, 2, "-999999999999999978945029970542243215.14", 7, 4, "", "true"},
                                    {38, 2, "10662385573335036607.39", 7, 4, "", "true"},
                                    {38, 2, "-999999999999999999999999957644985776.77", 7, 4, "", "true"},
                                    {38, 2, "29371647704315639616.75", 7, 4, "", "true"},
                                    {38, 2, "9993783244549670030620170.69", 7, 4, "", "true"},
                                    {38, 2, "-999999999999999999999886186022599100.51", 7, 4, "", "true"},
                                    {38, 2, "-999770565842135559886399063618188164.75", 7, 4, "", "true"},
                                    {38, 2, "187912389168220970385011811857771120.52", 7, 4, "", "true"},
                                    {38, 2, "80778730043802759964993.64", 7, 4, "", "true"},
                                    {38, 2, "53153216504366.94", 7, 4, "", "true"},
                                    {38, 2, "-999999426156534878290550511835786102.20", 7, 4, "", "true"},
                                    {38, 2, "249654142848251204.98", 7, 4, "", "true"},
                                    {38, 2, "-999999999999999999999990028041234490.01", 7, 4, "", "true"},
                                    {38, 2, "378104247079400993346358441704194.09", 7, 4, "", "true"},
                                    {38, 2, "-999999999999956244456293193301531681.69", 7, 4, "", "true"},
                                    {38, 2, "701411834604692317316873037158841057.28", 7, 4, "", "true"},
                                    {38, 2, "-999999999999999999999966070083611965.20", 7, 4, "", "true"},
                                    {38, 2, "-999999999999999993018167625804727211.71", 7, 4, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal32p7s4Normal) {
    CastTestCaseArray test_cases = {{38, 2, "10.86", 7, 4, "10.8600", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal64p18s0Abnormal) {
    CastTestCaseArray test_cases = {{38, 2, "548319404063486885604056947361178903.28", 18, 0, "", "true"},
                                    {38, 2, "-999999999999999999999999999999999993.62", 18, 0, "", "true"},
                                    {38, 2, "-999913047074960277439296706281992478.13", 18, 0, "", "true"},
                                    {38, 2, "432586663844949894543417495027.25", 18, 0, "", "true"},
                                    {38, 2, "-999999999999999999999998020550461701.77", 18, 0, "", "true"},
                                    {38, 2, "-999999999999596181497413694460339376.74", 18, 0, "", "true"},
                                    {38, 2, "-999999999999999999999999999999999999.91", 18, 0, "", "true"},
                                    {38, 2, "-999999999999999999999999999999991349.11", 18, 0, "", "true"},
                                    {38, 2, "1507031349898073171859506727258920.63", 18, 0, "", "true"},
                                    {38, 2, "26021121324137474472095.04", 18, 0, "", "true"},
                                    {38, 2, "-999999999999999999190044958004859248.00", 18, 0, "", "true"},
                                    {38, 2, "-999983587551865370843857586974947959.38", 18, 0, "", "true"},
                                    {38, 2, "-999999999999999999775346945695839597.40", 18, 0, "", "true"},
                                    {38, 2, "-999999999999999982009039368357239255.58", 18, 0, "", "true"},
                                    {38, 2, "-999999999999998759399370842382214526.34", 18, 0, "", "true"},
                                    {38, 2, "28812257822596655159.72", 18, 0, "", "true"},
                                    {38, 2, "-999999999981762084040600466886447627.80", 18, 0, "", "true"},
                                    {38, 2, "-999999999999999999999999999999520921.56", 18, 0, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {{38, 2, "2165.10", 18, 0, "2165", "false"},
                                    {38, 2, "44091638197617.51", 18, 0, "44091638197618", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal64p18s2Abnormal) {
    CastTestCaseArray test_cases = {{38, 2, "-871846643230848641553816126563784894.04", 18, 2, "", "true"},
                                    {38, 2, "-999977468659880723729657620006884706.28", 18, 2, "", "true"},
                                    {38, 2, "5310571316169413699211.16", 18, 2, "", "true"},
                                    {38, 2, "-999999999999999999991025492895499743.87", 18, 2, "", "true"},
                                    {38, 2, "-298588165395307682683126962841158942.70", 18, 2, "", "true"},
                                    {38, 2, "-999999999999612284064438342944429209.76", 18, 2, "", "true"},
                                    {38, 2, "-999999999999999999999958510156712599.39", 18, 2, "", "true"},
                                    {38, 2, "-999999999999999999999999999999392284.99", 18, 2, "", "true"},
                                    {38, 2, "-999999999999999999999999697788330202.94", 18, 2, "", "true"},
                                    {38, 2, "1119977635156031454842231870999034.34", 18, 2, "", "true"},
                                    {38, 2, "-999999999999999999999999999999999973.38", 18, 2, "", "true"},
                                    {38, 2, "-999999999999999985506446094861615810.58", 18, 2, "", "true"},
                                    {38, 2, "-999999999999999999999999999999999199.97", 18, 2, "", "true"},
                                    {38, 2, "-999999999999999999977439765592589231.21", 18, 2, "", "true"},
                                    {38, 2, "-999999999999999899689473433519362875.54", 18, 2, "", "true"},
                                    {38, 2, "-999999999999999999999999995469479364.79", 18, 2, "", "true"},
                                    {38, 2, "-999998740814675453628956046265765738.15", 18, 2, "", "true"},
                                    {38, 2, "7775378104171259703760.28", 18, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {{38, 2, "81986280308639732.72", 18, 2, "81986280308639732.72", "false"},
                                    {38, 2, "1202167.69", 18, 2, "1202167.69", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal64p18s9Abnormal) {
    CastTestCaseArray test_cases = {{38, 2, "-999999999999999999999999999999995566.29", 18, 9, "", "true"},
                                    {38, 2, "-999999999999999999999999988949156023.93", 18, 9, "", "true"},
                                    {38, 2, "-999999932593815288789931552888804977.16", 18, 9, "", "true"},
                                    {38, 2, "34992401653004095721631642803.35", 18, 9, "", "true"},
                                    {38, 2, "719813619365596578.52", 18, 9, "", "true"},
                                    {38, 2, "-990482907786298024293222210299001716.01", 18, 9, "", "true"},
                                    {38, 2, "183914467524132193548412092617.44", 18, 9, "", "true"},
                                    {38, 2, "-999999997201684814726541703299015039.60", 18, 9, "", "true"},
                                    {38, 2, "41435842741631866967370216359.76", 18, 9, "", "true"},
                                    {38, 2, "-999999999999999999999999999999942788.60", 18, 9, "", "true"},
                                    {38, 2, "4069335146004898980.99", 18, 9, "", "true"},
                                    {38, 2, "220421170633949548116349.17", 18, 9, "", "true"},
                                    {38, 2, "760108708579137.69", 18, 9, "", "true"},
                                    {38, 2, "-999999999999999999999978954934896620.57", 18, 9, "", "true"},
                                    {38, 2, "127457882164001158.11", 18, 9, "", "true"},
                                    {38, 2, "-999999999807704847959532000684353496.61", 18, 9, "", "true"},
                                    {38, 2, "20039318070520576.36", 18, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {{38, 2, "1008577.25", 18, 9, "1008577.250000000", "false"},
                                    {38, 2, "6.88", 18, 9, "6.880000000", "false"},
                                    {38, 2, "10.90", 18, 9, "10.900000000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {{38, 2, "7711055716175370921623187.12", 18, 18, "", "true"},
                                    {38, 2, "-999999999999999999999081761835831799.89", 18, 18, "", "true"},
                                    {38, 2, "-999999999999999999999999999999684557.23", 18, 18, "", "true"},
                                    {38, 2, "-999999999997668054844642160914039332.55", 18, 18, "", "true"},
                                    {38, 2, "77795462606952.23", 18, 18, "", "true"},
                                    {38, 2, "5622943986656069392231.12", 18, 18, "", "true"},
                                    {38, 2, "-999981872102653370747600303335100405.81", 18, 18, "", "true"},
                                    {38, 2, "48788798495784507583675036.98", 18, 18, "", "true"},
                                    {38, 2, "-999999999999999999999999999997026422.72", 18, 18, "", "true"},
                                    {38, 2, "-999999999999999997098952073124457719.72", 18, 18, "", "true"},
                                    {38, 2, "-999999999999999999999999999999999933.98", 18, 18, "", "true"},
                                    {38, 2, "5029091.58", 18, 18, "", "true"},
                                    {38, 2, "954776.06", 18, 18, "", "true"},
                                    {38, 2, "-999999999999999999999992106461718444.67", 18, 18, "", "true"},
                                    {38, 2, "2637845.97", 18, 18, "", "true"},
                                    {38, 2, "62205650732141127766247771177184.88", 18, 18, "", "true"},
                                    {38, 2, "2657946224646727.04", 18, 18, "", "true"},
                                    {38, 2, "-999999999999999999987224117084159734.24", 18, 18, "", "true"},
                                    {38, 2, "-999999883816101980524305941923292262.45", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal64p18s18Normal) {
    CastTestCaseArray test_cases = {{38, 2, "0.02", 18, 18, "0.020000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal64p15s13Abnormal) {
    CastTestCaseArray test_cases = {{38, 2, "-999999999999999999999999999999999999.61", 15, 13, "", "true"},
                                    {38, 2, "351664156706097005842165.54", 15, 13, "", "true"},
                                    {38, 2, "53050144940932522121949.36", 15, 13, "", "true"},
                                    {38, 2, "459903977903036772041897354040533.50", 15, 13, "", "true"},
                                    {38, 2, "15746517.30", 15, 13, "", "true"},
                                    {38, 2, "-999999999999998653484437906115447770.49", 15, 13, "", "true"},
                                    {38, 2, "1506630614408922849664.95", 15, 13, "", "true"},
                                    {38, 2, "-999999999951936195853056822868311964.31", 15, 13, "", "true"},
                                    {38, 2, "-999999999999999999999999999976308790.37", 15, 13, "", "true"},
                                    {38, 2, "122204063613586341905941000608333687.22", 15, 13, "", "true"},
                                    {38, 2, "-999999999999999999999999999999999999.22", 15, 13, "", "true"},
                                    {38, 2, "3012804308556534727823281468.02", 15, 13, "", "true"},
                                    {38, 2, "-999999999999999999996061721716162905.84", 15, 13, "", "true"},
                                    {38, 2, "386400307.50", 15, 13, "", "true"},
                                    {38, 2, "-999999999999807372067447990555757469.16", 15, 13, "", "true"},
                                    {38, 2, "-999999999999950921464783888775927798.33", 15, 13, "", "true"},
                                    {38, 2, "-999999999999999999999999998914730876.91", 15, 13, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{38, 2, "932.28", 15, 13, "932.2800000000000", "false"},
                                    {38, 2, "1.21", 15, 13, "1.2100000000000", "false"},
                                    {38, 2, "2.83", 15, 13, "2.8300000000000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {
            {38, 2, "49555244554292743104160333617480693.12", 38, 0, "49555244554292743104160333617480693", "false"},
            {38, 2, "-999999979672830867081623196300194769.99", 38, 0, "-999999979672830867081623196300194770",
             "false"},
            {38, 2, "-999999999999999999999999999999982422.25", 38, 0, "-999999999999999999999999999999982422",
             "false"},
            {38, 2, "-999999999999999999999999999999998913.18", 38, 0, "-999999999999999999999999999999998913",
             "false"},
            {38, 2, "105502164271943192.58", 38, 0, "105502164271943193", "false"},
            {38, 2, "-999999999999999724473325070076425237.14", 38, 0, "-999999999999999724473325070076425237",
             "false"},
            {38, 2, "-999999999999999999999999999999999999.57", 38, 0, "-1000000000000000000000000000000000000",
             "false"},
            {38, 2, "-999999999999999999999999999996020079.97", 38, 0, "-999999999999999999999999999996020080",
             "false"},
            {38, 2, "-999999999999999311818976367795437669.70", 38, 0, "-999999999999999311818976367795437670",
             "false"},
            {38, 2, "-999999999999999999999999999999999501.12", 38, 0, "-999999999999999999999999999999999501",
             "false"},
            {38, 2, "126893192032275578592555416358131.66", 38, 0, "126893192032275578592555416358132", "false"},
            {38, 2, "-999999999999999999999999999999999502.46", 38, 0, "-999999999999999999999999999999999502",
             "false"},
            {38, 2, "-298588165395307682683126962841158942.70", 38, 0, "-298588165395307682683126962841158943",
             "false"},
            {38, 2, "86723448722344460980.56", 38, 0, "86723448722344460981", "false"},
            {38, 2, "-999999999999999999999999999999999999.76", 38, 0, "-1000000000000000000000000000000000000",
             "false"},
            {38, 2, "-999998089316796258120980179130747295.50", 38, 0, "-999998089316796258120980179130747296",
             "false"},
            {38, 2, "-936908763905780129984354224543668267.31", 38, 0, "-936908763905780129984354224543668267",
             "false"},
            {38, 2, "55605791633816.71", 38, 0, "55605791633817", "false"},
            {38, 2, "-947737380384614238915335800644823641.32", 38, 0, "-947737380384614238915335800644823641",
             "false"},
            {38, 2, "-999999999999999999999999999999962689.71", 38, 0, "-999999999999999999999999999999962690",
             "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {
            {38, 2, "1758620711454370914044592125552.61", 38, 2, "1758620711454370914044592125552.61", "false"},
            {38, 2, "40521441.92", 38, 2, "40521441.92", "false"},
            {38, 2, "-999998515548580531260845281233209013.20", 38, 2, "-999998515548580531260845281233209013.20",
             "false"},
            {38, 2, "77157.64", 38, 2, "77157.64", "false"},
            {38, 2, "-999999999999999999999999999999999471.78", 38, 2, "-999999999999999999999999999999999471.78",
             "false"},
            {38, 2, "4883.82", 38, 2, "4883.82", "false"},
            {38, 2, "-999999999999999999999999999999997993.62", 38, 2, "-999999999999999999999999999999997993.62",
             "false"},
            {38, 2, "-999999999999999999999999980615522249.01", 38, 2, "-999999999999999999999999980615522249.01",
             "false"},
            {38, 2, "-992242993762768942956369131305371423.92", 38, 2, "-992242993762768942956369131305371423.92",
             "false"},
            {38, 2, "-999999999999999999999999999999833251.64", 38, 2, "-999999999999999999999999999999833251.64",
             "false"},
            {38, 2, "1409447320454898802843.47", 38, 2, "1409447320454898802843.47", "false"},
            {38, 2, "-999999999999999483955580566867779370.76", 38, 2, "-999999999999999483955580566867779370.76",
             "false"},
            {38, 2, "9264541555083.18", 38, 2, "9264541555083.18", "false"},
            {38, 2, "-999999999999999999999999999999996388.77", 38, 2, "-999999999999999999999999999999996388.77",
             "false"},
            {38, 2, "1480121190701994072703814215.77", 38, 2, "1480121190701994072703814215.77", "false"},
            {38, 2, "-999999999999999999999999999708951179.74", 38, 2, "-999999999999999999999999999708951179.74",
             "false"},
            {38, 2, "282542257.12", 38, 2, "282542257.12", "false"},
            {38, 2, "43059758171778973475717090.45", 38, 2, "43059758171778973475717090.45", "false"},
            {38, 2, "-999999999989753078749416237526643584.69", 38, 2, "-999999999989753078749416237526643584.69",
             "false"},
            {38, 2, "208088970971118905517689.23", 38, 2, "208088970971118905517689.23", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal128p38s9Abnormal) {
    CastTestCaseArray test_cases = {{38, 2, "1506121238266694539956275378845704.73", 38, 9, "", "true"},
                                    {38, 2, "-999999999999999999999999999999997772.53", 38, 9, "", "true"},
                                    {38, 2, "934772896639494765420302838435522418.62", 38, 9, "", "true"},
                                    {38, 2, "-999999999999999999999999999867876696.63", 38, 9, "", "true"},
                                    {38, 2, "-298588165395307682683126962841158942.70", 38, 9, "", "true"},
                                    {38, 2, "-999999999999999999998603149285332614.10", 38, 9, "", "true"},
                                    {38, 2, "-999999999999999999999999999999999999.95", 38, 9, "", "true"},
                                    {38, 2, "-999999988701996514346260468785269386.57", 38, 9, "", "true"},
                                    {38, 2, "-999999999999999999999999999999748796.51", 38, 9, "", "true"},
                                    {38, 2, "86900961810164336346692456914671.36", 38, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {
            {38, 2, "28119956422192.18", 38, 9, "28119956422192.180000000", "false"},
            {38, 2, "75031771331970745263150287738.62", 38, 9, "75031771331970745263150287738.620000000", "false"},
            {38, 2, "569027570132876925.27", 38, 9, "569027570132876925.270000000", "false"},
            {38, 2, "16271447574550679624094435.04", 38, 9, "16271447574550679624094435.040000000", "false"},
            {38, 2, "8108.95", 38, 9, "8108.950000000", "false"},
            {38, 2, "0.00", 38, 9, "0", "false"},
            {38, 2, "7134.99", 38, 9, "7134.990000000", "false"},
            {38, 2, "0.03", 38, 9, "0.030000000", "false"},
            {38, 2, "50398388.69", 38, 9, "50398388.690000000", "false"},
            {38, 2, "619008606173.35", 38, 9, "619008606173.350000000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal128p38s13Abnormal) {
    CastTestCaseArray test_cases = {{38, 2, "-999999999999999999528982998104157597.39", 38, 13, "", "true"},
                                    {38, 2, "34739698393583375444822588.42", 38, 13, "", "true"},
                                    {38, 2, "3052209536575338771336740513364.78", 38, 13, "", "true"},
                                    {38, 2, "89018006850662056867984604730038943.64", 38, 13, "", "true"},
                                    {38, 2, "-999999999999999999999999999999999999.97", 38, 13, "", "true"},
                                    {38, 2, "322500187389916390571435523849579.17", 38, 13, "", "true"},
                                    {38, 2, "85679568378669614992603071900375.97", 38, 13, "", "true"},
                                    {38, 2, "-388067822832036208673794221503186190.59", 38, 13, "", "true"},
                                    {38, 2, "2459372361363218272015122939118804.94", 38, 13, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {
            {38, 2, "1795619187919955333491379.09", 38, 13, "1795619187919955333491379.0900000000000", "false"},
            {38, 2, "2814017060677309417229.71", 38, 13, "2814017060677309417229.7100000000000", "false"},
            {38, 2, "8353.51", 38, 13, "8353.5100000000000", "false"},
            {38, 2, "1.30", 38, 13, "1.3000000000000", "false"},
            {38, 2, "8.86", 38, 13, "8.8600000000000", "false"},
            {38, 2, "341682696215.39", 38, 13, "341682696215.3900000000000", "false"},
            {38, 2, "120162915.65", 38, 13, "120162915.6500000000000", "false"},
            {38, 2, "0.40", 38, 13, "0.4000000000000", "false"},
            {38, 2, "16626517723610587.71", 38, 13, "16626517723610587.7100000000000", "false"},
            {38, 2, "81.47", 38, 13, "81.4700000000000", "false"},
            {38, 2, "3573897658722056.39", 38, 13, "3573897658722056.3900000000000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal128p38s18Abnormal) {
    CastTestCaseArray test_cases = {{38, 2, "-999999999998375525311614097109451292.99", 38, 18, "", "true"},
                                    {38, 2, "2444822842182792103952379621.39", 38, 18, "", "true"},
                                    {38, 2, "-999999999999999999999999999999999999.93", 38, 18, "", "true"},
                                    {38, 2, "-943133322403981939572415716269803002.44", 38, 18, "", "true"},
                                    {38, 2, "-999999999999999999999999998722456684.94", 38, 18, "", "true"},
                                    {38, 2, "-999999999999999999999757431726090931.58", 38, 18, "", "true"},
                                    {38, 2, "-999999999996862661875453439184809910.29", 38, 18, "", "true"},
                                    {38, 2, "8728606857329552813395727480647568.56", 38, 18, "", "true"},
                                    {38, 2, "774350284447594137124998706716035665.42", 38, 18, "", "true"},
                                    {38, 2, "-999999999999999999640688753042246043.77", 38, 18, "", "true"},
                                    {38, 2, "-999999999999999999999999998927085686.45", 38, 18, "", "true"},
                                    {38, 2, "65064131873665748113793.79", 38, 18, "", "true"},
                                    {38, 2, "-999999999999999999999999998418337026.50", 38, 18, "", "true"},
                                    {38, 2, "-999999999999999999999999999999872415.95", 38, 18, "", "true"},
                                    {38, 2, "-999998260536058183059832260383220696.78", 38, 18, "", "true"},
                                    {38, 2, "-999999999999999999976462815477746783.54", 38, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {
            {38, 2, "1096446652.25", 38, 18, "1096446652.250000000000000000", "false"},
            {38, 2, "154149696055647515.93", 38, 18, "154149696055647515.930000000000000000", "false"},
            {38, 2, "7971619.71", 38, 18, "7971619.710000000000000000", "false"},
            {38, 2, "27811.61", 38, 18, "27811.610000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal128p35s30Abnormal) {
    CastTestCaseArray test_cases = {{38, 2, "-999999999999999999999999999999999997.77", 35, 30, "", "true"},
                                    {38, 2, "10215994685231.51", 35, 30, "", "true"},
                                    {38, 2, "-999999888210507375445403551493772064.79", 35, 30, "", "true"},
                                    {38, 2, "-999999999999999999999999992264160357.51", 35, 30, "", "true"},
                                    {38, 2, "-999587170204312467544735614731626773.97", 35, 30, "", "true"},
                                    {38, 2, "-999652752697457079806020601580016902.38", 35, 30, "", "true"},
                                    {38, 2, "751667548670922647608.16", 35, 30, "", "true"},
                                    {38, 2, "-999999999999999999999998861297611736.02", 35, 30, "", "true"},
                                    {38, 2, "3084796963756840.93", 35, 30, "", "true"},
                                    {38, 2, "-731019041386971948224501258514590023.73", 35, 30, "", "true"},
                                    {38, 2, "-999913650155283167186346356499471259.50", 35, 30, "", "true"},
                                    {38, 2, "-999999999999999999999999999999999913.45", 35, 30, "", "true"},
                                    {38, 2, "-999999999999999999999999999999910020.57", 35, 30, "", "true"},
                                    {38, 2, "614648118192027074317939845613719.77", 35, 30, "", "true"},
                                    {38, 2, "529963528682303056476289026.60", 35, 30, "", "true"},
                                    {38, 2, "-999999999965659415685995288021167417.52", 35, 30, "", "true"},
                                    {38, 2, "57186891792788707250818414998.28", 35, 30, "", "true"},
                                    {38, 2, "560816167348592334207444693833985243.21", 35, 30, "", "true"},
                                    {38, 2, "285298043543920338343641095392.59", 35, 30, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s2ToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {{38, 2, "397.86", 35, 30, "397.860000000000000000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal32p9s0Abnormal) {
    CastTestCaseArray test_cases = {{38, 9, "56883208479284723014274908.384321609", 9, 0, "", "true"},
                                    {38, 9, "-99999999807644450568007597093.085096211", 9, 0, "", "true"},
                                    {38, 9, "-99999999999999999998871711090.037037251", 9, 0, "", "true"},
                                    {38, 9, "513576060615097.710275863", 9, 0, "", "true"},
                                    {38, 9, "-99999999966453647446040209561.417928346", 9, 0, "", "true"},
                                    {38, 9, "3427102567.522055938", 9, 0, "", "true"},
                                    {38, 9, "262614224262458208702420.574576660", 9, 0, "", "true"},
                                    {38, 9, "46272391039669.108883749", 9, 0, "", "true"},
                                    {38, 9, "6903868005826888627851289.754338037", 9, 0, "", "true"},
                                    {38, 9, "-99999999999999999999999999999.999999996", 9, 0, "", "true"},
                                    {38, 9, "51276647532.236470200", 9, 0, "", "true"},
                                    {38, 9, "5399291279920869.301587245", 9, 0, "", "true"},
                                    {38, 9, "-99999999146674066882553852404.292994960", 9, 0, "", "true"},
                                    {38, 9, "-99999999999999999999999999999.999993488", 9, 0, "", "true"},
                                    {38, 9, "1079575598056.510661433", 9, 0, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{38, 9, "49.824269182", 9, 0, "50", "false"},
                                    {38, 9, "484847.015661969", 9, 0, "484847", "false"},
                                    {38, 9, "0.000017196", 9, 0, "0", "false"},
                                    {38, 9, "0.000062720", 9, 0, "0", "false"},
                                    {38, 9, "201781555.759704952", 9, 0, "201781556", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal32p9s2Abnormal) {
    CastTestCaseArray test_cases = {{38, 9, "-99999999999999999999999999999.989830232", 9, 2, "", "true"},
                                    {38, 9, "3966599446113.668433396", 9, 2, "", "true"},
                                    {38, 9, "9188862169.372235579", 9, 2, "", "true"},
                                    {38, 9, "-99999999999999999999999988835.600931398", 9, 2, "", "true"},
                                    {38, 9, "-99999999999999999999999993691.993457780", 9, 2, "", "true"},
                                    {38, 9, "-99999999999999999999999998593.121465502", 9, 2, "", "true"},
                                    {38, 9, "1183676691783350192782941.694173221", 9, 2, "", "true"},
                                    {38, 9, "-99999999948896361027154511911.128575030", 9, 2, "", "true"},
                                    {38, 9, "-99973178526405452644137381740.756382607", 9, 2, "", "true"},
                                    {38, 9, "-99999999999999999999999103008.451932870", 9, 2, "", "true"},
                                    {38, 9, "-99999999999999999999999999996.481640199", 9, 2, "", "true"},
                                    {38, 9, "14653862669001.962289222", 9, 2, "", "true"},
                                    {38, 9, "-99999999999999999992338277835.802572942", 9, 2, "", "true"},
                                    {38, 9, "-99999999999968317965724522065.442127900", 9, 2, "", "true"},
                                    {38, 9, "28465954325512.862850524", 9, 2, "", "true"},
                                    {38, 9, "-99999999972693898031004243021.732018825", 9, 2, "", "true"},
                                    {38, 9, "-99999999999999999999957168008.186947264", 9, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {{38, 9, "3.5E-8", 9, 2, "0", "false"},
                                    {38, 9, "498.376948635", 9, 2, "498.38", "false"},
                                    {38, 9, "0.000058553", 9, 2, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {{38, 9, "4375977286537730531473239233.893907033", 9, 9, "", "true"},
                                    {38, 9, "-99999999999999999999999999999.999743026", 9, 9, "", "true"},
                                    {38, 9, "-47514519059459333783700195840.604554686", 9, 9, "", "true"},
                                    {38, 9, "561119428679530743008009.496034109", 9, 9, "", "true"},
                                    {38, 9, "-99999999999999999999999993435.697801682", 9, 9, "", "true"},
                                    {38, 9, "-99999999999999999999999999999.999999981", 9, 9, "", "true"},
                                    {38, 9, "7571529766.812986023", 9, 9, "", "true"},
                                    {38, 9, "-99999999999999999999999998159.588028424", 9, 9, "", "true"},
                                    {38, 9, "-99999999577662692673438419635.372194014", 9, 9, "", "true"},
                                    {38, 9, "-99999999999999999999999999999.564553016", 9, 9, "", "true"},
                                    {38, 9, "1892451343.363333669", 9, 9, "", "true"},
                                    {38, 9, "-99999999999999463282441828139.243132147", 9, 9, "", "true"},
                                    {38, 9, "175.687822563", 9, 9, "", "true"},
                                    {38, 9, "-99986263130585637864434163473.069010440", 9, 9, "", "true"},
                                    {38, 9, "-63974910271144598732177271288.377725704", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal32p9s9Normal) {
    CastTestCaseArray test_cases = {{38, 9, "0.000004379", 9, 9, "0.000004379", "false"},
                                    {38, 9, "0.918913206", 9, 9, "0.918913206", "false"},
                                    {38, 9, "2E-9", 9, 9, "0.000000002", "false"},
                                    {38, 9, "0.000197805", 9, 9, "0.000197805", "false"},
                                    {38, 9, "0.000001267", 9, 9, "0.000001267", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal32p7s4Abnormal) {
    CastTestCaseArray test_cases = {{38, 9, "4459762881086943513698470.964892968", 7, 4, "", "true"},
                                    {38, 9, "-99999999999999999620222346974.346573639", 7, 4, "", "true"},
                                    {38, 9, "-99939496128708335432352334229.739002841", 7, 4, "", "true"},
                                    {38, 9, "-99999999999999999999985764886.514398285", 7, 4, "", "true"},
                                    {38, 9, "-99999999999999999999999999999.999999887", 7, 4, "", "true"},
                                    {38, 9, "2299775443301.817644255", 7, 4, "", "true"},
                                    {38, 9, "-99999999999999999999999878720.633567413", 7, 4, "", "true"},
                                    {38, 9, "-99876416701299463544311632711.174832840", 7, 4, "", "true"},
                                    {38, 9, "-99999999999999999904408447872.059670566", 7, 4, "", "true"},
                                    {38, 9, "69178089.992805074", 7, 4, "", "true"},
                                    {38, 9, "-99999999999999999996745570176.524859443", 7, 4, "", "true"},
                                    {38, 9, "-99999999999999999999999999966.600016489", 7, 4, "", "true"},
                                    {38, 9, "-99999999999999999999999999999.999999992", 7, 4, "", "true"},
                                    {38, 9, "-99999984485545750482431574219.729577980", 7, 4, "", "true"},
                                    {38, 9, "-99999995148515155046346140319.086953445", 7, 4, "", "true"},
                                    {38, 9, "-99999999917577079952273333720.500350523", 7, 4, "", "true"},
                                    {38, 9, "12773918.209101317", 7, 4, "", "true"},
                                    {38, 9, "-99999999999999999999999988653.698450122", 7, 4, "", "true"},
                                    {38, 9, "-99999999999999999876484259594.706191691", 7, 4, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal32p7s4Normal) {
    CastTestCaseArray test_cases = {{38, 9, "0.006518909", 7, 4, "0.0065", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal64p18s0Abnormal) {
    CastTestCaseArray test_cases = {{38, 9, "-99999999999999999999999999999.999999975", 18, 0, "", "true"},
                                    {38, 9, "-99999999999999999999999999997.479191231", 18, 0, "", "true"},
                                    {38, 9, "-99999999999999999999999999999.997778614", 18, 0, "", "true"},
                                    {38, 9, "-29858816539530768268312696284.115894270", 18, 0, "", "true"},
                                    {38, 9, "-99999999999999999999999999824.939274679", 18, 0, "", "true"},
                                    {38, 9, "-99971314163000427606184852059.917480412", 18, 0, "", "true"},
                                    {38, 9, "-99995213353596285223572465504.551718910", 18, 0, "", "true"},
                                    {38, 9, "-99999999999999999999996835445.112155982", 18, 0, "", "true"},
                                    {38, 9, "-17956558851078613097873312422.188924004", 18, 0, "", "true"},
                                    {38, 9, "7552063377474279567436417.381689591", 18, 0, "", "true"},
                                    {38, 9, "-99998298282422937403353097009.207792138", 18, 0, "", "true"},
                                    {38, 9, "-99999999999999999999999999941.437734346", 18, 0, "", "true"},
                                    {38, 9, "-99999999999989454495099371507.955165114", 18, 0, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {{38, 9, "1.00E-7", 18, 0, "0", "false"},
                                    {38, 9, "528399150.192766488", 18, 0, "528399150", "false"},
                                    {38, 9, "139036212130.948232179", 18, 0, "139036212131", "false"},
                                    {38, 9, "0.013675123", 18, 0, "0", "false"},
                                    {38, 9, "92336.567053472", 18, 0, "92337", "false"},
                                    {38, 9, "1.2E-8", 18, 0, "0", "false"},
                                    {38, 9, "11.073865002", 18, 0, "11", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal64p18s2Abnormal) {
    CastTestCaseArray test_cases = {{38, 9, "-99999999999999999999199649372.891654748", 18, 2, "", "true"},
                                    {38, 9, "-99999999999999993052652166972.941900577", 18, 2, "", "true"},
                                    {38, 9, "-99999999999998121117317772351.315358386", 18, 2, "", "true"},
                                    {38, 9, "-99999999999999998579121454684.519050393", 18, 2, "", "true"},
                                    {38, 9, "-99999999999999999999923403307.247341047", 18, 2, "", "true"},
                                    {38, 9, "-99999999999999999999999999997.899688290", 18, 2, "", "true"},
                                    {38, 9, "8547500388165893371027.461829090", 18, 2, "", "true"},
                                    {38, 9, "5455438324901464461.342366688", 18, 2, "", "true"},
                                    {38, 9, "-99999999999999973799591080923.068724606", 18, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {{38, 9, "0.000005054", 18, 2, "0", "false"},
                                    {38, 9, "0.005521823", 18, 2, "0.01", "false"},
                                    {38, 9, "4328051188152.346628976", 18, 2, "4328051188152.35", "false"},
                                    {38, 9, "6103737664865620.256865116", 18, 2, "6103737664865620.26", "false"},
                                    {38, 9, "8418277199.093369335", 18, 2, "8418277199.09", "false"},
                                    {38, 9, "258008081.069711142", 18, 2, "258008081.07", "false"},
                                    {38, 9, "11680112.631742714", 18, 2, "11680112.63", "false"},
                                    {38, 9, "62000367975158191.063992283", 18, 2, "62000367975158191.06", "false"},
                                    {38, 9, "1466.774013092", 18, 2, "1466.77", "false"},
                                    {38, 9, "304516035.559734740", 18, 2, "304516035.56", "false"},
                                    {38, 9, "3.066154612", 18, 2, "3.07", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal64p18s9Abnormal) {
    CastTestCaseArray test_cases = {{38, 9, "-99999999999999999999999772889.717177235", 18, 9, "", "true"},
                                    {38, 9, "-52563447393709436631706016869.585124962", 18, 9, "", "true"},
                                    {38, 9, "1264103008107181404438842547.801976843", 18, 9, "", "true"},
                                    {38, 9, "2674750851563783.490847380", 18, 9, "", "true"},
                                    {38, 9, "-99999999999999999999999999999.975727508", 18, 9, "", "true"},
                                    {38, 9, "53727837619172107680.987563633", 18, 9, "", "true"},
                                    {38, 9, "-99999999999999999999999999999.889616139", 18, 9, "", "true"},
                                    {38, 9, "219443979444770601880136.059414360", 18, 9, "", "true"},
                                    {38, 9, "543813290372744421.565515812", 18, 9, "", "true"},
                                    {38, 9, "1422529425422997652061.363030391", 18, 9, "", "true"},
                                    {38, 9, "-99999999999999993235701188502.233192331", 18, 9, "", "true"},
                                    {38, 9, "-99999998436444288883431367244.190441101", 18, 9, "", "true"},
                                    {38, 9, "-99999999999606492474225788377.192085568", 18, 9, "", "true"},
                                    {38, 9, "16810656058426402.787065595", 18, 9, "", "true"},
                                    {38, 9, "-99820800790027498122850368660.060263481", 18, 9, "", "true"},
                                    {38, 9, "-99999995322609125651433373310.950984931", 18, 9, "", "true"},
                                    {38, 9, "8925921056098656833529581775.964311301", 18, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {{38, 9, "184421.152839397", 18, 9, "184421.152839397", "false"},
                                    {38, 9, "3474855.604525596", 18, 9, "3474855.604525596", "false"},
                                    {38, 9, "69918451.035739333", 18, 9, "69918451.035739333", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {{38, 9, "-98904823531849495656151704759.239346337", 18, 18, "", "true"},
                                    {38, 9, "4290792.856714913", 18, 18, "", "true"},
                                    {38, 9, "-99999999999999999999999999999.989555852", 18, 18, "", "true"},
                                    {38, 9, "312713628301736531680672.767122211", 18, 18, "", "true"},
                                    {38, 9, "317034702275906963307459.052288870", 18, 18, "", "true"},
                                    {38, 9, "150587.532022418", 18, 18, "", "true"},
                                    {38, 9, "-99999999999999999999999999622.912664288", 18, 18, "", "true"},
                                    {38, 9, "79132908.808260464", 18, 18, "", "true"},
                                    {38, 9, "352761908884306776644.387436891", 18, 18, "", "true"},
                                    {38, 9, "-99999999999999998376847993317.199111066", 18, 18, "", "true"},
                                    {38, 9, "-99999579761023014595255961444.302755387", 18, 18, "", "true"},
                                    {38, 9, "1814.625070993", 18, 18, "", "true"},
                                    {38, 9, "-99999999999994620621341483740.423467960", 18, 18, "", "true"},
                                    {38, 9, "-99999999999999999990989652881.420047884", 18, 18, "", "true"},
                                    {38, 9, "-99999999999999942625940563350.385737981", 18, 18, "", "true"},
                                    {38, 9, "-99999999999999999999999953477.304488746", 18, 18, "", "true"},
                                    {38, 9, "7646.369642016", 18, 18, "", "true"},
                                    {38, 9, "-99999999999999999999999999999.992156004", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal64p18s18Normal) {
    CastTestCaseArray test_cases = {{38, 9, "3.74E-7", 18, 18, "0.000000374000000000", "false"},
                                    {38, 9, "0.330571699", 18, 18, "0.330571699000000000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal64p15s13Abnormal) {
    CastTestCaseArray test_cases = {{38, 9, "-99999999999999999999999999999.998761317", 15, 13, "", "true"},
                                    {38, 9, "-98144677065593854416949190698.036289527", 15, 13, "", "true"},
                                    {38, 9, "-99999999999999999999998418962.893357766", 15, 13, "", "true"},
                                    {38, 9, "-99999999999999999999999999578.496850792", 15, 13, "", "true"},
                                    {38, 9, "15911790678213280481049024483.007214180", 15, 13, "", "true"},
                                    {38, 9, "23041208686569179037933533.897728286", 15, 13, "", "true"},
                                    {38, 9, "11138002.019917094", 15, 13, "", "true"},
                                    {38, 9, "-99999999999999999999999999999.999999097", 15, 13, "", "true"},
                                    {38, 9, "10052777617035143907412387712.555068350", 15, 13, "", "true"},
                                    {38, 9, "-99972081077046110927012125663.776575503", 15, 13, "", "true"},
                                    {38, 9, "1289840.753492709", 15, 13, "", "true"},
                                    {38, 9, "257563221988287.626482932", 15, 13, "", "true"},
                                    {38, 9, "22864270195672995.475242599", 15, 13, "", "true"},
                                    {38, 9, "-99999999999999999999999999999.179091620", 15, 13, "", "true"},
                                    {38, 9, "-99999999999999999999996074902.114307878", 15, 13, "", "true"},
                                    {38, 9, "29151296121629237800468.368070469", 15, 13, "", "true"},
                                    {38, 9, "-99999997167042023534236254030.987230803", 15, 13, "", "true"},
                                    {38, 9, "6725782583852023001334361971.051801352", 15, 13, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{38, 9, "418.025145828", 15, 13, "418.0251458280000", "false"},
                                    {38, 9, "0.006526125", 15, 13, "0.0065261250000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {
            {38, 9, "2E-9", 38, 0, "0", "false"},
            {38, 9, "-99990236897966833651902001327.883904799", 38, 0, "-99990236897966833651902001328", "false"},
            {38, 9, "-99710762556896573983166727076.717013578", 38, 0, "-99710762556896573983166727077", "false"},
            {38, 9, "-99999999999999999999999999999.999999969", 38, 0, "-100000000000000000000000000000", "false"},
            {38, 9, "-99999999999999999999999999592.188212903", 38, 0, "-99999999999999999999999999592", "false"},
            {38, 9, "-99999999999999999999999999999.999999719", 38, 0, "-100000000000000000000000000000", "false"},
            {38, 9, "545771396729.241918751", 38, 0, "545771396729", "false"},
            {38, 9, "679953836915945309.360081086", 38, 0, "679953836915945309", "false"},
            {38, 9, "8695578196393.193153885", 38, 0, "8695578196393", "false"},
            {38, 9, "-99999999999998990563561540998.192820658", 38, 0, "-99999999999998990563561540998", "false"},
            {38, 9, "0.122254773", 38, 0, "0", "false"},
            {38, 9, "209536950657439919967407691.369260910", 38, 0, "209536950657439919967407691", "false"},
            {38, 9, "1E-9", 38, 0, "0", "false"},
            {38, 9, "-99999999999723295291967118567.512986150", 38, 0, "-99999999999723295291967118568", "false"},
            {38, 9, "-99999999999999999999999999999.999995134", 38, 0, "-100000000000000000000000000000", "false"},
            {38, 9, "190661429514931474066.027291729", 38, 0, "190661429514931474066", "false"},
            {38, 9, "2.900045995", 38, 0, "3", "false"},
            {38, 9, "0.000004162", 38, 0, "0", "false"},
            {38, 9, "365993852.625297619", 38, 0, "365993853", "false"},
            {38, 9, "3600.620072615", 38, 0, "3601", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {
            {38, 9, "-99999999999999999999999972267.063418115", 38, 2, "-99999999999999999999999972267.06", "false"},
            {38, 9, "4720276983805.407329428", 38, 2, "4720276983805.41", "false"},
            {38, 9, "-99999999999999999999999999999.996766849", 38, 2, "-100000000000000000000000000000", "false"},
            {38, 9, "-99999999999999999999999999999.999829510", 38, 2, "-100000000000000000000000000000", "false"},
            {38, 9, "1195994244488904546154.547275661", 38, 2, "1195994244488904546154.55", "false"},
            {38, 9, "-99999999999997723728871325355.405104048", 38, 2, "-99999999999997723728871325355.41", "false"},
            {38, 9, "3678977003041818.845846941", 38, 2, "3678977003041818.85", "false"},
            {38, 9, "14258907605.519733865", 38, 2, "14258907605.52", "false"},
            {38, 9, "17718496196867.695429266", 38, 2, "17718496196867.70", "false"},
            {38, 9, "1.774976488", 38, 2, "1.77", "false"},
            {38, 9, "8106441085057682898.506073010", 38, 2, "8106441085057682898.51", "false"},
            {38, 9, "-99999998958842184336034549350.284125127", 38, 2, "-99999998958842184336034549350.28", "false"},
            {38, 9, "-99999999999999999999999999983.255741784", 38, 2, "-99999999999999999999999999983.26", "false"},
            {38, 9, "4938563512655970.877773438", 38, 2, "4938563512655970.88", "false"},
            {38, 9, "-99999999999999999999999999999.380402505", 38, 2, "-99999999999999999999999999999.38", "false"},
            {38, 9, "2868615590401671286181454447.005167618", 38, 2, "2868615590401671286181454447.01", "false"},
            {38, 9, "-99999999999999999999998438549.330466042", 38, 2, "-99999999999999999999998438549.33", "false"},
            {38, 9, "-99999999999999999716426773005.726182582", 38, 2, "-99999999999999999716426773005.73", "false"},
            {38, 9, "1094.987648901", 38, 2, "1094.99", "false"},
            {38, 9, "-99999999999999999999999999999.999999543", 38, 2, "-100000000000000000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {
            {38, 9, "707891611121121.030452576", 38, 9, "707891611121121.030452576", "false"},
            {38, 9, "17657.044603480", 38, 9, "17657.044603480", "false"},
            {38, 9, "-99992221418445959332717815584.670701513", 38, 9, "-99992221418445959332717815584.670701513",
             "false"},
            {38, 9, "68.375414858", 38, 9, "68.375414858", "false"},
            {38, 9, "30393990052629268.398539403", 38, 9, "30393990052629268.398539403", "false"},
            {38, 9, "34992299476065779354.621641694", 38, 9, "34992299476065779354.621641694", "false"},
            {38, 9, "-99999999999999999930630883109.205821105", 38, 9, "-99999999999999999930630883109.205821105",
             "false"},
            {38, 9, "42551250378.417997849", 38, 9, "42551250378.417997849", "false"},
            {38, 9, "800873739172.240558214", 38, 9, "800873739172.240558214", "false"},
            {38, 9, "-99999999999999999999999999950.720003324", 38, 9, "-99999999999999999999999999950.720003324",
             "false"},
            {38, 9, "4.4E-8", 38, 9, "0.000000044", "false"},
            {38, 9, "-99999996378658049154044875521.285621969", 38, 9, "-99999996378658049154044875521.285621969",
             "false"},
            {38, 9, "-99999999999999996800997912571.199287309", 38, 9, "-99999999999999996800997912571.199287309",
             "false"},
            {38, 9, "267298437589371.440759579", 38, 9, "267298437589371.440759579", "false"},
            {38, 9, "15.079544839", 38, 9, "15.079544839", "false"},
            {38, 9, "3.795792726", 38, 9, "3.795792726", "false"},
            {38, 9, "44304269520461514096846830463.954971896", 38, 9, "44304269520461514096846830463.954971896",
             "false"},
            {38, 9, "0.000521994", 38, 9, "0.000521994", "false"},
            {38, 9, "339480.867027561", 38, 9, "339480.867027561", "false"},
            {38, 9, "-99999999999999999999999999965.753262862", 38, 9, "-99999999999999999999999999965.753262862",
             "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal128p38s13Abnormal) {
    CastTestCaseArray test_cases = {{38, 9, "-99999999999999999999944410520.902401056", 38, 13, "", "true"},
                                    {38, 9, "-99845493273993065200068846466.695526827", 38, 13, "", "true"},
                                    {38, 9, "-99999999999999999999382859038.186577500", 38, 13, "", "true"},
                                    {38, 9, "-99999999999999485337149980783.336666057", 38, 13, "", "true"},
                                    {38, 9, "-99999999999999999907410186063.501988173", 38, 13, "", "true"},
                                    {38, 9, "-99889872993284595225369235093.245130638", 38, 13, "", "true"},
                                    {38, 9, "-99999999999880808239442627943.527698107", 38, 13, "", "true"},
                                    {38, 9, "-99999999999999951790991257690.019966481", 38, 13, "", "true"},
                                    {38, 9, "-99999999999999999998906351162.096624142", 38, 13, "", "true"},
                                    {38, 9, "-99999999999999999999996404647.780670409", 38, 13, "", "true"},
                                    {38, 9, "-99999999999999999999999999999.999999932", 38, 13, "", "true"},
                                    {38, 9, "-99999999999999996569264911978.379812806", 38, 13, "", "true"},
                                    {38, 9, "-99999999999999999999999999968.765994445", 38, 13, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {
            {38, 9, "394213426.670145759", 38, 13, "394213426.6701457590000", "false"},
            {38, 9, "1056814.593041404", 38, 13, "1056814.5930414040000", "false"},
            {38, 9, "5549774930909673745124.910988478", 38, 13, "5549774930909673745124.9109884780000", "false"},
            {38, 9, "0.000410838", 38, 13, "0.0004108380000", "false"},
            {38, 9, "6596886028092131965944295.064091237", 38, 13, "6596886028092131965944295.0640912370000", "false"},
            {38, 9, "631899556350711962903905.195349051", 38, 13, "631899556350711962903905.1953490510000", "false"},
            {38, 9, "6.85E-7", 38, 13, "0.0000006850000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal128p38s18Abnormal) {
    CastTestCaseArray test_cases = {{38, 9, "-99999999999999999999911135323.219723861", 38, 18, "", "true"},
                                    {38, 9, "-99999999992336299754096198421.325137842", 38, 18, "", "true"},
                                    {38, 9, "-99998997232641268990790602942.109807921", 38, 18, "", "true"},
                                    {38, 9, "-99999999999999999999306107685.623122613", 38, 18, "", "true"},
                                    {38, 9, "-99999999999999999999985665569.638067298", 38, 18, "", "true"},
                                    {38, 9, "-99999999999999965644302667899.117169158", 38, 18, "", "true"},
                                    {38, 9, "-99999999999999999999797051559.724729541", 38, 18, "", "true"},
                                    {38, 9, "24518215533810296708512.118071489", 38, 18, "", "true"},
                                    {38, 9, "-99999999999999999999992181929.483270319", 38, 18, "", "true"},
                                    {38, 9, "-99999999999999999998724588770.321632278", 38, 18, "", "true"},
                                    {38, 9, "-99963947346925227513352715414.409559511", 38, 18, "", "true"},
                                    {38, 9, "-99999999999999999997017010955.841533759", 38, 18, "", "true"},
                                    {38, 9, "63278638023329995241700925624.534390247", 38, 18, "", "true"},
                                    {38, 9, "-99999999999999999999999999549.409880535", 38, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {
            {38, 9, "92566981042.407124433", 38, 18, "92566981042.407124433000000000", "false"},
            {38, 9, "3.6E-8", 38, 18, "0.000000036000000000", "false"},
            {38, 9, "6730.323294988", 38, 18, "6730.323294988000000000", "false"},
            {38, 9, "0.067029959", 38, 18, "0.067029959000000000", "false"},
            {38, 9, "0.000210245", 38, 18, "0.000210245000000000", "false"},
            {38, 9, "30732893149039636120.527243223", 38, 18, "30732893149039636120.527243223000000000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal128p35s30Abnormal) {
    CastTestCaseArray test_cases = {{38, 9, "10849305361644540.555661079", 35, 30, "", "true"},
                                    {38, 9, "16943371271089872363.600782143", 35, 30, "", "true"},
                                    {38, 9, "-99999999999999999997995737661.778493180", 35, 30, "", "true"},
                                    {38, 9, "146369246678339423055.985388824", 35, 30, "", "true"},
                                    {38, 9, "3217304705821818.353222432", 35, 30, "", "true"},
                                    {38, 9, "-99708524514654994207944700356.820282838", 35, 30, "", "true"},
                                    {38, 9, "-96136627725670380137455969193.582786252", 35, 30, "", "true"},
                                    {38, 9, "-99999999999999999999999994789.839378793", 35, 30, "", "true"},
                                    {38, 9, "-99999074378171389297247681245.899936347", 35, 30, "", "true"},
                                    {38, 9, "11873340112597251.833574951", 35, 30, "", "true"},
                                    {38, 9, "-99999999999999999999897461206.071068485", 35, 30, "", "true"},
                                    {38, 9, "446215689454288.665641806", 35, 30, "", "true"},
                                    {38, 9, "-99999987274668441163438731289.396056589", 35, 30, "", "true"},
                                    {38, 9, "5856090168700374428524637317.250428208", 35, 30, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s9ToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {{38, 9, "844.088212765", 35, 30, "844.088212765000000000000000000000", "false"},
                                    {38, 9, "36386.178047593", 35, 30, "36386.178047593000000000000000000000", "false"},
                                    {38, 9, "1620.179963903", 35, 30, "1620.179963903000000000000000000000", "false"},
                                    {38, 9, "1.1E-8", 35, 30, "0.000000011000000000000000000000", "false"},
                                    {38, 9, "51.848242198", 35, 30, "51.848242198000000000000000000000", "false"},
                                    {38, 9, "20.962663443", 35, 30, "20.962663443000000000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal32p9s0Abnormal) {
    CastTestCaseArray test_cases = {{38, 13, "337338446455503.1481792477626", 9, 0, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999996851", 9, 0, "", "true"},
                                    {38, 13, "26701499615714352.3212944770462", 9, 0, "", "true"},
                                    {38, 13, "-9999999999999986777856608.6967605678143", 9, 0, "", "true"},
                                    {38, 13, "-9999999999999999920360106.6559458486589", 9, 0, "", "true"},
                                    {38, 13, "1864595628109941302.5179239884957", 9, 0, "", "true"},
                                    {38, 13, "-9999999824954460921693993.3874448817347", 9, 0, "", "true"},
                                    {38, 13, "-9999999999999999999999632.4416977822254", 9, 0, "", "true"},
                                    {38, 13, "31589911215788.2984472019014", 9, 0, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{38, 13, "420968.3169367274834", 9, 0, "420968", "false"},
                                    {38, 13, "830274.9502141850712", 9, 0, "830275", "false"},
                                    {38, 13, "3.628E-10", 9, 0, "0", "false"},
                                    {38, 13, "429608.0788390814127", 9, 0, "429608", "false"},
                                    {38, 13, "4.3E-12", 9, 0, "0", "false"},
                                    {38, 13, "2.0446951853166", 9, 0, "2", "false"},
                                    {38, 13, "0.0159834726132", 9, 0, "0", "false"},
                                    {38, 13, "556507654.0700060021750", 9, 0, "556507654", "false"},
                                    {38, 13, "0.0020065776341", 9, 0, "0", "false"},
                                    {38, 13, "28.0794041339298", 9, 0, "28", "false"},
                                    {38, 13, "2.50605E-8", 9, 0, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal32p9s2Abnormal) {
    CastTestCaseArray test_cases = {{38, 13, "-9999999999999996697574164.7435853998612", 9, 2, "", "true"},
                                    {38, 13, "-9999999999999999223582289.6299734712555", 9, 2, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999102810959", 9, 2, "", "true"},
                                    {38, 13, "-9999999998855981855790075.1807764044590", 9, 2, "", "true"},
                                    {38, 13, "-6910053417583244970227451.9784480772193", 9, 2, "", "true"},
                                    {38, 13, "-9999999999568925282830390.7400704632056", 9, 2, "", "true"},
                                    {38, 13, "-9999999999999999999999988.5200275778135", 9, 2, "", "true"},
                                    {38, 13, "30548646933886122.8868428821813", 9, 2, "", "true"},
                                    {38, 13, "-9999999999988885756116598.3037061930447", 9, 2, "", "true"},
                                    {38, 13, "13743600764571.7623823060497", 9, 2, "", "true"},
                                    {38, 13, "-9999999999999986069770108.5400495949060", 9, 2, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999987699", 9, 2, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9993202683722", 9, 2, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999947346425", 9, 2, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999999996", 9, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {{38, 13, "0.0306006965315", 9, 2, "0.03", "false"},
                                    {38, 13, "222.0872811240132", 9, 2, "222.09", "false"},
                                    {38, 13, "2.2E-12", 9, 2, "0", "false"},
                                    {38, 13, "1.084562E-7", 9, 2, "0", "false"},
                                    {38, 13, "1.78E-11", 9, 2, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {{38, 13, "307544005335777808705495.7588981542349", 9, 9, "", "true"},
                                    {38, 13, "-9999999999999847035551251.3994379422936", 9, 9, "", "true"},
                                    {38, 13, "-9999999999999895885435246.1905942079973", 9, 9, "", "true"},
                                    {38, 13, "1032190284219536043241875.2725652707926", 9, 9, "", "true"},
                                    {38, 13, "66041769151455.3839179678908", 9, 9, "", "true"},
                                    {38, 13, "53462945106724889974.6161017268855", 9, 9, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999650501951", 9, 9, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999999511", 9, 9, "", "true"},
                                    {38, 13, "1782199.4196745460464", 9, 9, "", "true"},
                                    {38, 13, "-9999999999999999999999999.5970506378813", 9, 9, "", "true"},
                                    {38, 13, "1528680919828555644.0260258068635", 9, 9, "", "true"},
                                    {38, 13, "-9999711695199202634743519.2958576891753", 9, 9, "", "true"},
                                    {38, 13, "-9999999999999712286291819.4288618544227", 9, 9, "", "true"},
                                    {38, 13, "23618339197.8834674647210", 9, 9, "", "true"},
                                    {38, 13, "-9999999999999964563453548.3395623289927", 9, 9, "", "true"},
                                    {38, 13, "2799316747258215282224.5058005395098", 9, 9, "", "true"},
                                    {38, 13, "-9999813899154060477598003.7222374703187", 9, 9, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999999946", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal32p9s9Normal) {
    CastTestCaseArray test_cases = {{38, 13, "0.0000062363373", 9, 9, "0.000006236", "false"},
                                    {38, 13, "0.0797691210276", 9, 9, "0.079769121", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal32p7s4Abnormal) {
    CastTestCaseArray test_cases = {{38, 13, "-9999870331592298734476179.6500907191343", 7, 4, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999997103", 7, 4, "", "true"},
                                    {38, 13, "-9999999999999999969166789.9105901515809", 7, 4, "", "true"},
                                    {38, 13, "-9999999999999989042414274.4102508462856", 7, 4, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999999985", 7, 4, "", "true"},
                                    {38, 13, "211059783.2158017014828", 7, 4, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9998462567409", 7, 4, "", "true"},
                                    {38, 13, "12191288281099337.8532615032033", 7, 4, "", "true"},
                                    {38, 13, "-9999649162895397249698525.2673053906309", 7, 4, "", "true"},
                                    {38, 13, "-9058973410409791101012987.0024626105426", 7, 4, "", "true"},
                                    {38, 13, "-9999999999969379185126913.5288920958062", 7, 4, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999772471", 7, 4, "", "true"},
                                    {38, 13, "182421383407217855.3829576725206", 7, 4, "", "true"},
                                    {38, 13, "-9999999999999842338976513.5755276287152", 7, 4, "", "true"},
                                    {38, 13, "298473.8476382624485", 7, 4, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal32p7s4Normal) {
    CastTestCaseArray test_cases = {{38, 13, "6.80E-11", 7, 4, "0", "false"},
                                    {38, 13, "1E-13", 7, 4, "0", "false"},
                                    {38, 13, "33.3743403200212", 7, 4, "33.3743", "false"},
                                    {38, 13, "4.308084E-7", 7, 4, "0", "false"},
                                    {38, 13, "2E-13", 7, 4, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal64p18s0Abnormal) {
    CastTestCaseArray test_cases = {{38, 13, "143223758482619246807840.9684983298333", 18, 0, "", "true"},
                                    {38, 13, "-9999999999999999999994617.8010726395681", 18, 0, "", "true"},
                                    {38, 13, "-9999999526997351042855374.5999513414908", 18, 0, "", "true"},
                                    {38, 13, "-9999999999999999998833664.9537235552995", 18, 0, "", "true"},
                                    {38, 13, "-9999999947962232542246231.3773401770172", 18, 0, "", "true"},
                                    {38, 13, "-9999997393709271476810895.9104888422052", 18, 0, "", "true"},
                                    {38, 13, "-9999999999999999995284102.1222013158100", 18, 0, "", "true"},
                                    {38, 13, "145920338844829183372428.4483309508590", 18, 0, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9567614489595", 18, 0, "", "true"},
                                    {38, 13, "-9999999999999999993799389.5446826347167", 18, 0, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {
            {38, 13, "2.511E-10", 18, 0, "0", "false"},
            {38, 13, "9.51027E-8", 18, 0, "0", "false"},
            {38, 13, "0.0000350778266", 18, 0, "0", "false"},
            {38, 13, "0.0022610129464", 18, 0, "0", "false"},
            {38, 13, "25942120135050087.8007593921466", 18, 0, "25942120135050088", "false"},
            {38, 13, "4.91E-11", 18, 0, "0", "false"},
            {38, 13, "4.8372E-9", 18, 0, "0", "false"},
            {38, 13, "1.5366E-9", 18, 0, "0", "false"},
            {38, 13, "2267032278165285372.7145566882728", 18, 0, "2267032278165285373", "false"},
            {38, 13, "25797701246310.1725478537366", 18, 0, "25797701246310", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal64p18s2Abnormal) {
    CastTestCaseArray test_cases = {{38, 13, "2075459207793852456787.4586968157006", 18, 2, "", "true"},
                                    {38, 13, "-9999999999999999999994226.8314786165428", 18, 2, "", "true"},
                                    {38, 13, "6928184562357765974021.2123529601040", 18, 2, "", "true"},
                                    {38, 13, "-9999999787230631890812735.2564614606686", 18, 2, "", "true"},
                                    {38, 13, "-9999999999999999999999999.7283821797600", 18, 2, "", "true"},
                                    {38, 13, "-9999994689491238836031414.8035433588337", 18, 2, "", "true"},
                                    {38, 13, "7014118346046923173168730.3715884105728", 18, 2, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999948921", 18, 2, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9579694899814", 18, 2, "", "true"},
                                    {38, 13, "-9999979410856078443118016.7352835237803", 18, 2, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999999942", 18, 2, "", "true"},
                                    {38, 13, "-9999999999999999999999999.5524750584049", 18, 2, "", "true"},
                                    {38, 13, "-9995420381993007573373869.1479098533985", 18, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {{38, 13, "860.2017707964178", 18, 2, "860.20", "false"},
                                    {38, 13, "42216734.6801089265143", 18, 2, "42216734.68", "false"},
                                    {38, 13, "27929412692401115.6178650307929", 18, 2, "27929412692401115.62", "false"},
                                    {38, 13, "58311512.6344496731456", 18, 2, "58311512.63", "false"},
                                    {38, 13, "44250200889092.8486080234116", 18, 2, "44250200889092.85", "false"},
                                    {38, 13, "4.852522E-7", 18, 2, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal64p18s9Abnormal) {
    CastTestCaseArray test_cases = {{38, 13, "2564454836529261129820741.1698393942355", 18, 9, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999999991", 18, 9, "", "true"},
                                    {38, 13, "-9999999999999999999976656.8700679692747", 18, 9, "", "true"},
                                    {38, 13, "55930595412.9602192339278", 18, 9, "", "true"},
                                    {38, 13, "446923216834133535.7815457164133", 18, 9, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9937609409784", 18, 9, "", "true"},
                                    {38, 13, "-9999999999999999772450730.6352588784721", 18, 9, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999874681", 18, 9, "", "true"},
                                    {38, 13, "-9999999999152833706258701.6767379204654", 18, 9, "", "true"},
                                    {38, 13, "2739787453943.5140717286498", 18, 9, "", "true"},
                                    {38, 13, "-2985881653953076826831269.6284115894270", 18, 9, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999880634077", 18, 9, "", "true"},
                                    {38, 13, "-9999999999987268982859288.4202100736162", 18, 9, "", "true"},
                                    {38, 13, "-9999999999999999999999999.7385206885306", 18, 9, "", "true"},
                                    {38, 13, "-9999999999999109226639898.8037876440321", 18, 9, "", "true"},
                                    {38, 13, "-9996504686752373845059224.8985096419259", 18, 9, "", "true"},
                                    {38, 13, "-9999999999999999825984458.1480933376892", 18, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {{38, 13, "0.0003018623393", 18, 9, "0.000301862", "false"},
                                    {38, 13, "5E-13", 18, 9, "0", "false"},
                                    {38, 13, "1.94E-11", 18, 9, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {{38, 13, "-9999939525094161998574694.7227461983954", 18, 18, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999177845946", 18, 18, "", "true"},
                                    {38, 13, "-9999252594203868941048207.2391215226604", 18, 18, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999987795308", 18, 18, "", "true"},
                                    {38, 13, "61939502818281905889779.3670341936503", 18, 18, "", "true"},
                                    {38, 13, "-9999999999729382076701502.8651097313807", 18, 18, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9985785115306", 18, 18, "", "true"},
                                    {38, 13, "-9999999999999969472409717.2779450900879", 18, 18, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9994889774433", 18, 18, "", "true"},
                                    {38, 13, "-9999999999855755090969020.3792954281341", 18, 18, "", "true"},
                                    {38, 13, "7588446140964523.2192629916505", 18, 18, "", "true"},
                                    {38, 13, "-9999998921013577662078934.7275939771318", 18, 18, "", "true"},
                                    {38, 13, "5571389463949068031.9049418829779", 18, 18, "", "true"},
                                    {38, 13, "-9999999999985045799624249.6759083327320", 18, 18, "", "true"},
                                    {38, 13, "568824854877108466002.7094198590744", 18, 18, "", "true"},
                                    {38, 13, "-9999999999663426949070993.3144220222536", 18, 18, "", "true"},
                                    {38, 13, "-9999999999999997585411564.3145140096541", 18, 18, "", "true"},
                                    {38, 13, "991803204084586.3401202534060", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal64p18s18Normal) {
    CastTestCaseArray test_cases = {{38, 13, "0.0029993843754", 18, 18, "0.002999384375400000", "false"},
                                    {38, 13, "1.2915E-9", 18, 18, "0.000000001291500000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal64p15s13Abnormal) {
    CastTestCaseArray test_cases = {{38, 13, "-9910582456100754967747032.0264588501837", 15, 13, "", "true"},
                                    {38, 13, "-9999999999999999922787004.6108791693872", 15, 13, "", "true"},
                                    {38, 13, "1348153368997294295261.2564995350086", 15, 13, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9996061530927", 15, 13, "", "true"},
                                    {38, 13, "-2985881653953076826831269.6284115894270", 15, 13, "", "true"},
                                    {38, 13, "-9999999999999997270989818.4964193828669", 15, 13, "", "true"},
                                    {38, 13, "-9999999999999999999975533.6244816871266", 15, 13, "", "true"},
                                    {38, 13, "10606521279909.2759851919185", 15, 13, "", "true"},
                                    {38, 13, "597083667959180604230359.8389755534161", 15, 13, "", "true"},
                                    {38, 13, "-9999999556647014396785237.1730594523145", 15, 13, "", "true"},
                                    {38, 13, "5478524992.9874798401607", 15, 13, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999999981", 15, 13, "", "true"},
                                    {38, 13, "-9999999999942985919286355.1143819018818", 15, 13, "", "true"},
                                    {38, 13, "-9999999999999999999827558.9930100923218", 15, 13, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{38, 13, "2.1415877245160", 15, 13, "2.1415877245160", "false"},
                                    {38, 13, "3.231475E-7", 15, 13, "0.0000003231475", "false"},
                                    {38, 13, "45.5299170817863", 15, 13, "45.5299170817863", "false"},
                                    {38, 13, "890194.2436543010954", 15, 13, "890194.2436543010954", "false"},
                                    {38, 13, "97.8007296638666", 15, 13, "97.8007296638666", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {
            {38, 13, "502505486577452346002.6122247230926", 38, 0, "502505486577452346003", "false"},
            {38, 13, "231267997722254520.7969273467662", 38, 0, "231267997722254521", "false"},
            {38, 13, "-9999999999999999999999999.9993262305156", 38, 0, "-10000000000000000000000000", "false"},
            {38, 13, "57214370195590688847009.2214719601146", 38, 0, "57214370195590688847009", "false"},
            {38, 13, "-9999999999999999999999999.9973502902969", 38, 0, "-10000000000000000000000000", "false"},
            {38, 13, "-9999999999999999999999999.9999996970178", 38, 0, "-10000000000000000000000000", "false"},
            {38, 13, "-9999999999999999999999999.9999994231843", 38, 0, "-10000000000000000000000000", "false"},
            {38, 13, "4414934602419440065.0995223263067", 38, 0, "4414934602419440065", "false"},
            {38, 13, "-9999999999999999999999990.3433302844100", 38, 0, "-9999999999999999999999990", "false"},
            {38, 13, "-9999999999999999999999999.9999999999956", 38, 0, "-10000000000000000000000000", "false"},
            {38, 13, "-9999999999649458824458344.2071050359036", 38, 0, "-9999999999649458824458344", "false"},
            {38, 13, "-9999999999748224445519992.3558525953769", 38, 0, "-9999999999748224445519992", "false"},
            {38, 13, "-9999999999999999999999993.0731316326921", 38, 0, "-9999999999999999999999993", "false"},
            {38, 13, "53129256282985805575.0909062709200", 38, 0, "53129256282985805575", "false"},
            {38, 13, "-9999999999999999999999999.9999999976135", 38, 0, "-10000000000000000000000000", "false"},
            {38, 13, "130619106080352531873.2493533669027", 38, 0, "130619106080352531873", "false"},
            {38, 13, "-9999999999999999999999120.5052956436966", 38, 0, "-9999999999999999999999121", "false"},
            {38, 13, "-9999999999999999998683759.8927206264386", 38, 0, "-9999999999999999998683760", "false"},
            {38, 13, "7768760639936867265502039.7331685541077", 38, 0, "7768760639936867265502040", "false"},
            {38, 13, "-9999999999999999998516291.5304123821053", 38, 0, "-9999999999999999998516292", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {
            {38, 13, "0.0000014487690", 38, 2, "0", "false"},
            {38, 13, "540034072118517.0246797890002", 38, 2, "540034072118517.02", "false"},
            {38, 13, "-9999824160172633114119679.1950492843927", 38, 2, "-9999824160172633114119679.20", "false"},
            {38, 13, "-9999999999999999999999999.2046098152031", 38, 2, "-9999999999999999999999999.20", "false"},
            {38, 13, "212458135011677094.0304924902881", 38, 2, "212458135011677094.03", "false"},
            {38, 13, "-9999999999999999999998614.5611847688304", 38, 2, "-9999999999999999999998614.56", "false"},
            {38, 13, "355600717365266001967.5392874613908", 38, 2, "355600717365266001967.54", "false"},
            {38, 13, "19555787358.1958653836785", 38, 2, "19555787358.20", "false"},
            {38, 13, "-9999996403148257892875058.1116676335590", 38, 2, "-9999996403148257892875058.11", "false"},
            {38, 13, "-9795500504250765881813924.4378390617477", 38, 2, "-9795500504250765881813924.44", "false"},
            {38, 13, "-9999999999882914354523372.0406795174871", 38, 2, "-9999999999882914354523372.04", "false"},
            {38, 13, "-9999999999999999999999999.9999992449539", 38, 2, "-10000000000000000000000000", "false"},
            {38, 13, "-9999999999999999784847904.6741487429296", 38, 2, "-9999999999999999784847904.67", "false"},
            {38, 13, "23505144172620384.2503640962855", 38, 2, "23505144172620384.25", "false"},
            {38, 13, "0.3778166522412", 38, 2, "0.38", "false"},
            {38, 13, "-9999999999999999999999999.9999999999688", 38, 2, "-10000000000000000000000000", "false"},
            {38, 13, "-9999999999999999999999999.9999999999746", 38, 2, "-10000000000000000000000000", "false"},
            {38, 13, "-9999863578457495930705608.6256808525124", 38, 2, "-9999863578457495930705608.63", "false"},
            {38, 13, "-9999999999999999999999951.8803373925877", 38, 2, "-9999999999999999999999951.88", "false"},
            {38, 13, "-9999999999999999999999999.9999999998547", 38, 2, "-10000000000000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {
            {38, 13, "-9821320225254082300177181.5744286565403", 38, 9, "-9821320225254082300177181.574428657",
             "false"},
            {38, 13, "3.26E-11", 38, 9, "0", "false"},
            {38, 13, "0.0000043107424", 38, 9, "0.000004311", "false"},
            {38, 13, "-9999999999999999940067157.1931306021048", 38, 9, "-9999999999999999940067157.193130602",
             "false"},
            {38, 13, "-9999999999999999167610921.5516919156871", 38, 9, "-9999999999999999167610921.551691916",
             "false"},
            {38, 13, "-9999991936783476757840918.8654061523460", 38, 9, "-9999991936783476757840918.865406152",
             "false"},
            {38, 13, "-9999999999999999999999999.7973033683457", 38, 9, "-9999999999999999999999999.797303368",
             "false"},
            {38, 13, "-9999999999999999339503145.3566770894891", 38, 9, "-9999999999999999339503145.356677089",
             "false"},
            {38, 13, "-9999999999999999999999999.9999999999784", 38, 9, "-10000000000000000000000000", "false"},
            {38, 13, "-6152509595986585653774659.7864158097692", 38, 9, "-6152509595986585653774659.786415810",
             "false"},
            {38, 13, "241845912122428531904.4976182082090", 38, 9, "241845912122428531904.497618208", "false"},
            {38, 13, "1.6E-12", 38, 9, "0", "false"},
            {38, 13, "62274317983454108915490.3474795658092", 38, 9, "62274317983454108915490.347479566", "false"},
            {38, 13, "0.0005424257556", 38, 9, "0.000542426", "false"},
            {38, 13, "-9999961984298834806079342.7457240287327", 38, 9, "-9999961984298834806079342.745724029",
             "false"},
            {38, 13, "-3607769978918569567620339.2949275977700", 38, 9, "-3607769978918569567620339.294927598",
             "false"},
            {38, 13, "0.0000418163034", 38, 9, "0.000041816", "false"},
            {38, 13, "-8881446710730376681471510.6915569135517", 38, 9, "-8881446710730376681471510.691556914",
             "false"},
            {38, 13, "775974877889653.1563367807413", 38, 9, "775974877889653.156336781", "false"},
            {38, 13, "10.0361524519269", 38, 9, "10.036152452", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {
            {38, 13, "0.2164503761731", 38, 13, "0.2164503761731", "false"},
            {38, 13, "5.507E-10", 38, 13, "0.0000000005507", "false"},
            {38, 13, "-9999999999999999999999999.9999999999998", 38, 13, "-9999999999999999999999999.9999999999998",
             "false"},
            {38, 13, "244290199790371425.6692635224530", 38, 13, "244290199790371425.6692635224530", "false"},
            {38, 13, "-9999994216853542757696474.0411533831874", 38, 13, "-9999994216853542757696474.0411533831874",
             "false"},
            {38, 13, "1972240159.1887523605631", 38, 13, "1972240159.1887523605631", "false"},
            {38, 13, "14577672.1341629859238", 38, 13, "14577672.1341629859238", "false"},
            {38, 13, "-9999999999999999999999999.6520416249421", 38, 13, "-9999999999999999999999999.6520416249421",
             "false"},
            {38, 13, "5282485431405939805.4167208226976", 38, 13, "5282485431405939805.4167208226976", "false"},
            {38, 13, "-9999999999781436728435721.7100323185041", 38, 13, "-9999999999781436728435721.7100323185041",
             "false"},
            {38, 13, "-9999999999999999402520961.2516155915841", 38, 13, "-9999999999999999402520961.2516155915841",
             "false"},
            {38, 13, "-8739790950209660261786619.4448772143666", 38, 13, "-8739790950209660261786619.4448772143666",
             "false"},
            {38, 13, "0.2027291778635", 38, 13, "0.2027291778635", "false"},
            {38, 13, "0.0000364146815", 38, 13, "0.0000364146815", "false"},
            {38, 13, "-9999999999999999999999999.9993143367042", 38, 13, "-9999999999999999999999999.9993143367042",
             "false"},
            {38, 13, "6.1051291647981", 38, 13, "6.1051291647981", "false"},
            {38, 13, "-9999999999999999999999999.9999987866886", 38, 13, "-9999999999999999999999999.9999987866886",
             "false"},
            {38, 13, "-9999999999999953655110832.5203756428286", 38, 13, "-9999999999999953655110832.5203756428286",
             "false"},
            {38, 13, "-9728384207707051035152367.7131747280587", 38, 13, "-9728384207707051035152367.7131747280587",
             "false"},
            {38, 13, "-9999999990990318559672797.1793581443839", 38, 13, "-9999999990990318559672797.1793581443839",
             "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal128p38s18Abnormal) {
    CastTestCaseArray test_cases = {{38, 13, "-9999985496335285622879245.7377307271605", 38, 18, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999931318496", 38, 18, "", "true"},
                                    {38, 13, "-9999951423354876518571394.9097330968582", 38, 18, "", "true"},
                                    {38, 13, "-9999999999999720596376045.9072798111826", 38, 18, "", "true"},
                                    {38, 13, "-9999999999999893075863962.6885274582777", 38, 18, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999999990", 38, 18, "", "true"},
                                    {38, 13, "-9999999999999999994459033.7683454361892", 38, 18, "", "true"},
                                    {38, 13, "-9999999999897343023802185.5681322449026", 38, 18, "", "true"},
                                    {38, 13, "-9996184723218255910335269.6082764517833", 38, 18, "", "true"},
                                    {38, 13, "181066322646907251163308.8389047835874", 38, 18, "", "true"},
                                    {38, 13, "-9999999999999999997914981.7333754128227", 38, 18, "", "true"},
                                    {38, 13, "-9999999999999999999999995.6233148354577", 38, 18, "", "true"},
                                    {38, 13, "-9999999999999999999999999.1229097766363", 38, 18, "", "true"},
                                    {38, 13, "2004587250764756363894406.2320327028457", 38, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {{38, 13, "1748.0833808883983", 38, 18, "1748.083380888398300000", "false"},
                                    {38, 13, "1E-13", 38, 18, "0.000000000000100000", "false"},
                                    {38, 13, "71782.2330385474633", 38, 18, "71782.233038547463300000", "false"},
                                    {38, 13, "4.4E-12", 38, 18, "0.000000000004400000", "false"},
                                    {38, 13, "6E-13", 38, 18, "0.000000000000600000", "false"},
                                    {38, 13, "0.0003032905256", 38, 18, "0.000303290525600000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal128p35s30Abnormal) {
    CastTestCaseArray test_cases = {{38, 13, "-9999997765792390164905761.5251092071590", 35, 30, "", "true"},
                                    {38, 13, "-9999949305825587705011880.5378017598763", 35, 30, "", "true"},
                                    {38, 13, "-9993160795048095625558968.4247712361768", 35, 30, "", "true"},
                                    {38, 13, "-9999999999999353510569898.9999881761422", 35, 30, "", "true"},
                                    {38, 13, "228200887714066649456.0280578681340", 35, 30, "", "true"},
                                    {38, 13, "-9999999999999996980531279.1169319740570", 35, 30, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999999937", 35, 30, "", "true"},
                                    {38, 13, "3412504552107135821189876.9268780438131", 35, 30, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9996224881459", 35, 30, "", "true"},
                                    {38, 13, "-9999999998396732997648280.9123530330187", 35, 30, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9999999992420", 35, 30, "", "true"},
                                    {38, 13, "489606198654889579151131.9193062958717", 35, 30, "", "true"},
                                    {38, 13, "-9987815541747299511124605.5979320289299", 35, 30, "", "true"},
                                    {38, 13, "-9999955308240546109876159.9794393612722", 35, 30, "", "true"},
                                    {38, 13, "69037088985074678.4701744414651", 35, 30, "", "true"},
                                    {38, 13, "6232641179838.1689384019150", 35, 30, "", "true"},
                                    {38, 13, "-9999999986825973755264624.9218715520871", 35, 30, "", "true"},
                                    {38, 13, "-9999999999999999999999999.9669042577267", 35, 30, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s13ToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {{38, 13, "1.2E-12", 35, 30, "0.000000000001200000000000000000", "false"},
                                    {38, 13, "3E-13", 35, 30, "0.000000000000300000000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal32p9s0Abnormal) {
    CastTestCaseArray test_cases = {{38, 18, "-99999999999999999999.999999999967945250", 9, 0, "", "true"},
                                    {38, 18, "-99996685171213744470.723217339954456041", 9, 0, "", "true"},
                                    {38, 18, "-99999999999999999999.999999963034258235", 9, 0, "", "true"},
                                    {38, 18, "-99938310280268554592.824168733978532450", 9, 0, "", "true"},
                                    {38, 18, "-99999999999075075560.959994335640365223", 9, 0, "", "true"},
                                    {38, 18, "-98720878785313219782.772090732122312878", 9, 0, "", "true"},
                                    {38, 18, "2536243140390.613529509247789249", 9, 0, "", "true"},
                                    {38, 18, "-29858816539530768268.312696284115894270", 9, 0, "", "true"},
                                    {38, 18, "-99999999999999999999.999999999999398814", 9, 0, "", "true"},
                                    {38, 18, "-99999999999999999888.156658270260464612", 9, 0, "", "true"},
                                    {38, 18, "-99999999999999999999.999999999999998743", 9, 0, "", "true"},
                                    {38, 18, "-99999999999999999999.999999999999946838", 9, 0, "", "true"},
                                    {38, 18, "-99999999999999999999.999999977421323274", 9, 0, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{38, 18, "0.000518782142426913", 9, 0, "0", "false"},
                                    {38, 18, "24606.686047453090492329", 9, 0, "24607", "false"},
                                    {38, 18, "25754.739059697599235199", 9, 0, "25755", "false"},
                                    {38, 18, "2338481.380346005819106075", 9, 0, "2338481", "false"},
                                    {38, 18, "22132156.754016743610511529", 9, 0, "22132157", "false"},
                                    {38, 18, "5.38326949701E-7", 9, 0, "0", "false"},
                                    {38, 18, "14.044688749673905797", 9, 0, "14", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal32p9s2Abnormal) {
    CastTestCaseArray test_cases = {{38, 18, "-99999965092130265217.506601396239769131", 9, 2, "", "true"},
                                    {38, 18, "30923144.223641509581166974", 9, 2, "", "true"},
                                    {38, 18, "-99999999999999999999.999999999999999984", 9, 2, "", "true"},
                                    {38, 18, "-99999999999999717042.517985122522147995", 9, 2, "", "true"},
                                    {38, 18, "-99999999999999999999.993777216533812149", 9, 2, "", "true"},
                                    {38, 18, "-99999999999999999999.999999901930663557", 9, 2, "", "true"},
                                    {38, 18, "19140982668568.410070382825207840", 9, 2, "", "true"},
                                    {38, 18, "-99969157396871378153.690152925526633626", 9, 2, "", "true"},
                                    {38, 18, "-99999999999569422251.825794646833669795", 9, 2, "", "true"},
                                    {38, 18, "2165372967826546.218318404361637751", 9, 2, "", "true"},
                                    {38, 18, "9132133053.079724269248125901", 9, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {{38, 18, "1.7E-17", 9, 2, "0", "false"},
                                    {38, 18, "0E-18", 9, 2, "0", "false"},
                                    {38, 18, "6.88E-16", 9, 2, "0", "false"},
                                    {38, 18, "9367339.454327697261520518", 9, 2, "9367339.45", "false"},
                                    {38, 18, "154.139782266260912203", 9, 2, "154.14", "false"},
                                    {38, 18, "0.000006922242149590", 9, 2, "0", "false"},
                                    {38, 18, "5.886999693E-9", 9, 2, "0", "false"},
                                    {38, 18, "270605.439708388112924182", 9, 2, "270605.44", "false"},
                                    {38, 18, "2.4390E-14", 9, 2, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {{38, 18, "-99999999999999999999.999999999999950881", 9, 9, "", "true"},
                                    {38, 18, "-99999999999999999998.250677717653744264", 9, 9, "", "true"},
                                    {38, 18, "-99999999999948018794.859670969188688436", 9, 9, "", "true"},
                                    {38, 18, "463157063998133927.262874877432325611", 9, 9, "", "true"},
                                    {38, 18, "3203627.076734030848094859", 9, 9, "", "true"},
                                    {38, 18, "9156459536173.728767453888479553", 9, 9, "", "true"},
                                    {38, 18, "-99999999999999999999.999988022101172013", 9, 9, "", "true"},
                                    {38, 18, "-99986363167057449485.442825628437089862", 9, 9, "", "true"},
                                    {38, 18, "-99999999999999999999.999999457343997824", 9, 9, "", "true"},
                                    {38, 18, "-99999999999790127164.853582720659285053", 9, 9, "", "true"},
                                    {38, 18, "-99999999984322324525.673757262656968096", 9, 9, "", "true"},
                                    {38, 18, "2.343303051391807438", 9, 9, "", "true"},
                                    {38, 18, "-99999999998006359744.149125600165423025", 9, 9, "", "true"},
                                    {38, 18, "-99999999999999999999.999999999999993209", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal32p9s9Normal) {
    CastTestCaseArray test_cases = {{38, 18, "0E-18", 9, 9, "0", "false"},
                                    {38, 18, "9.93618679091E-7", 9, 9, "0.000000994", "false"},
                                    {38, 18, "0.001114247981119761", 9, 9, "0.001114248", "false"},
                                    {38, 18, "0.000005623633164161", 9, 9, "0.000005624", "false"},
                                    {38, 18, "3.1784306145E-8", 9, 9, "0.000000032", "false"},
                                    {38, 18, "9.8650502E-11", 9, 9, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal32p7s4Abnormal) {
    CastTestCaseArray test_cases = {{38, 18, "-99999999999999999999.999993061010914254", 7, 4, "", "true"},
                                    {38, 18, "-99999999999999999999.999999970207724304", 7, 4, "", "true"},
                                    {38, 18, "73013689.201953833279688394", 7, 4, "", "true"},
                                    {38, 18, "7690041918813661.792822731923408976", 7, 4, "", "true"},
                                    {38, 18, "764418151870384845.152628245115242973", 7, 4, "", "true"},
                                    {38, 18, "-99999999999999999999.999999999934692727", 7, 4, "", "true"},
                                    {38, 18, "-99999999999999763752.896454453919293301", 7, 4, "", "true"},
                                    {38, 18, "-99999959269934883693.368338026801609738", 7, 4, "", "true"},
                                    {38, 18, "-99999999999999999999.911883186769191545", 7, 4, "", "true"},
                                    {38, 18, "-99999999999249437371.091102325262028702", 7, 4, "", "true"},
                                    {38, 18, "-99999999999945271594.095425678941224521", 7, 4, "", "true"},
                                    {38, 18, "-99758773383714571450.037358734317968491", 7, 4, "", "true"},
                                    {38, 18, "-99999999999999999999.999989732276160830", 7, 4, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal32p7s4Normal) {
    CastTestCaseArray test_cases = {{38, 18, "1.939103213E-9", 7, 4, "0", "false"},
                                    {38, 18, "0.033306688451288554", 7, 4, "0.0333", "false"},
                                    {38, 18, "3.74194242E-10", 7, 4, "0", "false"},
                                    {38, 18, "646.332572475555223243", 7, 4, "646.3326", "false"},
                                    {38, 18, "2.63154E-13", 7, 4, "0", "false"},
                                    {38, 18, "0.000068541966286611", 7, 4, "0.0001", "false"},
                                    {38, 18, "0.051476419411504571", 7, 4, "0.0515", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal64p18s0Abnormal) {
    CastTestCaseArray test_cases = {{38, 18, "-99999999999999999999.999999999919564821", 18, 0, "", "true"},
                                    {38, 18, "-99999999999975285945.493745105405864332", 18, 0, "", "true"},
                                    {38, 18, "-99999999999999999999.999999962436510182", 18, 0, "", "true"},
                                    {38, 18, "-98698826715603838680.128821635006160520", 18, 0, "", "true"},
                                    {38, 18, "-99999999999999999999.999990520363420507", 18, 0, "", "true"},
                                    {38, 18, "-99999999999999999991.041613778355215220", 18, 0, "", "true"},
                                    {38, 18, "-99999999999999997499.776396568659925397", 18, 0, "", "true"},
                                    {38, 18, "-52674485403123244825.526493725352273096", 18, 0, "", "true"},
                                    {38, 18, "-60888329621861519439.034573357419459863", 18, 0, "", "true"},
                                    {38, 18, "-99999999867650831798.402653939729574211", 18, 0, "", "true"},
                                    {38, 18, "-99999999999999999999.999999998153260827", 18, 0, "", "true"},
                                    {38, 18, "-99999999999999999996.538592045740736761", 18, 0, "", "true"},
                                    {38, 18, "-99999999999999997390.012995223031465384", 18, 0, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {{38, 18, "375255250057.225210257731148776", 18, 0, "375255250057", "false"},
                                    {38, 18, "7.782379080E-9", 18, 0, "0", "false"},
                                    {38, 18, "7.85079E-13", 18, 0, "0", "false"},
                                    {38, 18, "2.38746780447E-7", 18, 0, "0", "false"},
                                    {38, 18, "5.13218070E-10", 18, 0, "0", "false"},
                                    {38, 18, "7.3547587E-11", 18, 0, "0", "false"},
                                    {38, 18, "1.7578703E-11", 18, 0, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal64p18s2Abnormal) {
    CastTestCaseArray test_cases = {{38, 18, "-99999999999999999999.999999999941186305", 18, 2, "", "true"},
                                    {38, 18, "-99999999630668559867.928343727324939188", 18, 2, "", "true"},
                                    {38, 18, "-99999999999999999999.999999968609444343", 18, 2, "", "true"},
                                    {38, 18, "-99999999999999999675.448227354018105054", 18, 2, "", "true"},
                                    {38, 18, "-99999999999999999999.875537833145965073", 18, 2, "", "true"},
                                    {38, 18, "-99999999999999999999.999999999999657625", 18, 2, "", "true"},
                                    {38, 18, "-99999999999999999999.999999241153071407", 18, 2, "", "true"},
                                    {38, 18, "-99999999999999890464.951510883702754922", 18, 2, "", "true"},
                                    {38, 18, "-99999999999999999999.487736877130593355", 18, 2, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {{38, 18, "203616752068.512660416077639848", 18, 2, "203616752068.51", "false"},
                                    {38, 18, "27739.011653535740464815", 18, 2, "27739.01", "false"},
                                    {38, 18, "651806071023.413983295631370479", 18, 2, "651806071023.41", "false"},
                                    {38, 18, "4468810856415.334533248174491342", 18, 2, "4468810856415.33", "false"},
                                    {38, 18, "10.433679174485825111", 18, 2, "10.43", "false"},
                                    {38, 18, "1325.081759326688208057", 18, 2, "1325.08", "false"},
                                    {38, 18, "0.000440080052629009", 18, 2, "0", "false"},
                                    {38, 18, "57684.848566460243282292", 18, 2, "57684.85", "false"},
                                    {38, 18, "8.91391509263E-7", 18, 2, "0", "false"},
                                    {38, 18, "0.006896223657726423", 18, 2, "0.01", "false"},
                                    {38, 18, "1E-18", 18, 2, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal64p18s9Abnormal) {
    CastTestCaseArray test_cases = {{38, 18, "-99999999999999999999.999998453971345091", 18, 9, "", "true"},
                                    {38, 18, "-99999992059191313841.080578260830971738", 18, 9, "", "true"},
                                    {38, 18, "-99999999999999998328.910752919973494158", 18, 9, "", "true"},
                                    {38, 18, "-99999999992642859331.855401643573788712", 18, 9, "", "true"},
                                    {38, 18, "-99999999999998290379.230226863811042533", 18, 9, "", "true"},
                                    {38, 18, "-99999999999895196997.752265555950617180", 18, 9, "", "true"},
                                    {38, 18, "-99999999999999999989.340230606592691782", 18, 9, "", "true"},
                                    {38, 18, "-99999999999999031613.772965617085275229", 18, 9, "", "true"},
                                    {38, 18, "10713456562007703.702841820896942440", 18, 9, "", "true"},
                                    {38, 18, "14406019160455145590.426658599395839642", 18, 9, "", "true"},
                                    {38, 18, "-99999999999999999999.998879476253757895", 18, 9, "", "true"},
                                    {38, 18, "-99999999999999999999.999999999973767736", 18, 9, "", "true"},
                                    {38, 18, "-99353329408827209662.014772259388286408", 18, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {{38, 18, "4.272644009567055635", 18, 9, "4.272644010", "false"},
                                    {38, 18, "1.2E-17", 18, 9, "0", "false"},
                                    {38, 18, "0.000267358985998594", 18, 9, "0.000267359", "false"},
                                    {38, 18, "1E-18", 18, 9, "0", "false"},
                                    {38, 18, "9.195812E-12", 18, 9, "0", "false"},
                                    {38, 18, "12643.845991406732843826", 18, 9, "12643.845991407", "false"},
                                    {38, 18, "1.0E-17", 18, 9, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {{38, 18, "65299020.732726507987575621", 18, 18, "", "true"},
                                    {38, 18, "72.555573848587376398", 18, 18, "", "true"},
                                    {38, 18, "-99999999999999999995.511279805868616742", 18, 18, "", "true"},
                                    {38, 18, "231135705.245769742225876332", 18, 18, "", "true"},
                                    {38, 18, "-99999999999999988377.255303816704440533", 18, 18, "", "true"},
                                    {38, 18, "531411.156704686731167777", 18, 18, "", "true"},
                                    {38, 18, "28945264437509.550962638936335347", 18, 18, "", "true"},
                                    {38, 18, "7221238482971870.299724564426899069", 18, 18, "", "true"},
                                    {38, 18, "-99999999999999999999.028994193933018573", 18, 18, "", "true"},
                                    {38, 18, "-99999999999999999999.992610933677855508", 18, 18, "", "true"},
                                    {38, 18, "-96514670942718799555.737840776540128231", 18, 18, "", "true"},
                                    {38, 18, "-99999999999999999999.999999994644130771", 18, 18, "", "true"},
                                    {38, 18, "-99999943718202202822.067766777278001409", 18, 18, "", "true"},
                                    {38, 18, "-99999999999999999999.999999999999999215", 18, 18, "", "true"},
                                    {38, 18, "-99999999999999999999.999999999995272769", 18, 18, "", "true"},
                                    {38, 18, "539650933.502713684606827207", 18, 18, "", "true"},
                                    {38, 18, "2059230.525149734644016667", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal64p18s18Normal) {
    CastTestCaseArray test_cases = {{38, 18, "1E-18", 18, 18, "0.000000000000000001", "false"},
                                    {38, 18, "7.029E-15", 18, 18, "0.000000000000007029", "false"},
                                    {38, 18, "0.000002237390951322", 18, 18, "0.000002237390951322", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal64p15s13Abnormal) {
    CastTestCaseArray test_cases = {{38, 18, "-99999999981342025648.438557116007801257", 15, 13, "", "true"},
                                    {38, 18, "96018980.631282037084709608", 15, 13, "", "true"},
                                    {38, 18, "1659192192465698.719827147489130515", 15, 13, "", "true"},
                                    {38, 18, "-99999999999999999999.999997044619637568", 15, 13, "", "true"},
                                    {38, 18, "-99999999869320851073.598157762772286585", 15, 13, "", "true"},
                                    {38, 18, "34983590682224716.652559920861945348", 15, 13, "", "true"},
                                    {38, 18, "-99999999999999999994.422573821155743903", 15, 13, "", "true"},
                                    {38, 18, "-99999999999995621811.384545024009816052", 15, 13, "", "true"},
                                    {38, 18, "-99999999999999999868.713769545944059642", 15, 13, "", "true"},
                                    {38, 18, "-99999998468064466879.747582217720247698", 15, 13, "", "true"},
                                    {38, 18, "-99999999399624408892.199828453561272188", 15, 13, "", "true"},
                                    {38, 18, "-99968211358196645581.875250591168291637", 15, 13, "", "true"},
                                    {38, 18, "-99999999999999999999.999999994108155024", 15, 13, "", "true"},
                                    {38, 18, "-99999999999999999999.999999999999870216", 15, 13, "", "true"},
                                    {38, 18, "-99999999999999999999.999999999999995947", 15, 13, "", "true"},
                                    {38, 18, "-99999999999999999999.999999984589587367", 15, 13, "", "true"},
                                    {38, 18, "-99999999999999999984.239759942079422848", 15, 13, "", "true"},
                                    {38, 18, "67667468804697477673.815527244905397696", 15, 13, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {{38, 18, "0.000003421055561661", 15, 13, "0.0000034210556", "false"},
                                    {38, 18, "6.437E-15", 15, 13, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {
            {38, 18, "52890565668320.221502699653691148", 38, 0, "52890565668320", "false"},
            {38, 18, "-99999999999999999999.999999723327150843", 38, 0, "-100000000000000000000", "false"},
            {38, 18, "-99999999999999999999.999999999999999991", 38, 0, "-100000000000000000000", "false"},
            {38, 18, "3.4022E-14", 38, 0, "0", "false"},
            {38, 18, "-99999999999999999999.999999999999743622", 38, 0, "-100000000000000000000", "false"},
            {38, 18, "9410.985168210394928590", 38, 0, "9411", "false"},
            {38, 18, "7E-18", 38, 0, "0", "false"},
            {38, 18, "-99999997110501745521.656132204814651164", 38, 0, "-99999997110501745522", "false"},
            {38, 18, "-99999999999999999999.999999593257535501", 38, 0, "-100000000000000000000", "false"},
            {38, 18, "13044.083493857946293927", 38, 0, "13044", "false"},
            {38, 18, "49572961848223.037158393792362435", 38, 0, "49572961848223", "false"},
            {38, 18, "58207674161.838205968673762843", 38, 0, "58207674162", "false"},
            {38, 18, "12511821986136914287.894215490984860985", 38, 0, "12511821986136914288", "false"},
            {38, 18, "0.000336796461950393", 38, 0, "0", "false"},
            {38, 18, "-99999999999992661044.881307966595757356", 38, 0, "-99999999999992661045", "false"},
            {38, 18, "-99999997006651462636.142908487449298403", 38, 0, "-99999997006651462636", "false"},
            {38, 18, "20234099581190753.664936745118523330", 38, 0, "20234099581190754", "false"},
            {38, 18, "-99999999999999999999.999999999999999986", 38, 0, "-100000000000000000000", "false"},
            {38, 18, "-99970993287878855204.080347701516288917", 38, 0, "-99970993287878855204", "false"},
            {38, 18, "-99999999999999999862.137230052532297520", 38, 0, "-99999999999999999862", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {
            {38, 18, "-99999999999999999999.999999998110023857", 38, 2, "-100000000000000000000", "false"},
            {38, 18, "-99999999999999999999.999989177972580578", 38, 2, "-100000000000000000000", "false"},
            {38, 18, "6.3E-17", 38, 2, "0", "false"},
            {38, 18, "1543.392562497597912355", 38, 2, "1543.39", "false"},
            {38, 18, "3.730E-15", 38, 2, "0", "false"},
            {38, 18, "3024473391792.418291360296446223", 38, 2, "3024473391792.42", "false"},
            {38, 18, "4493839699255.591788158497727672", 38, 2, "4493839699255.59", "false"},
            {38, 18, "0.684769241068327145", 38, 2, "0.68", "false"},
            {38, 18, "52317872.768934511879348709", 38, 2, "52317872.77", "false"},
            {38, 18, "-99999999987036989046.733169797583854772", 38, 2, "-99999999987036989046.73", "false"},
            {38, 18, "4.801278310E-9", 38, 2, "0", "false"},
            {38, 18, "7747.043103644798930136", 38, 2, "7747.04", "false"},
            {38, 18, "959773.068598117554741190", 38, 2, "959773.07", "false"},
            {38, 18, "52624061723322540459.878689054519546215", 38, 2, "52624061723322540459.88", "false"},
            {38, 18, "-99999999990909505069.577889832319412039", 38, 2, "-99999999990909505069.58", "false"},
            {38, 18, "2.0E-17", 38, 2, "0", "false"},
            {38, 18, "2451455133411736463.020843563294691136", 38, 2, "2451455133411736463.02", "false"},
            {38, 18, "-99999999999999993665.346121777157306305", 38, 2, "-99999999999999993665.35", "false"},
            {38, 18, "-99999999999244161090.630333722944588464", 38, 2, "-99999999999244161090.63", "false"},
            {38, 18, "-99999999999999924897.087499242996041983", 38, 2, "-99999999999999924897.09", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {
            {38, 18, "-99999999999999999999.999999999971405622", 38, 9, "-100000000000000000000", "false"},
            {38, 18, "3.067857E-12", 38, 9, "0", "false"},
            {38, 18, "3403949758958109997.817294601778239368", 38, 9, "3403949758958109997.817294602", "false"},
            {38, 18, "-99999999999999999711.387757641698071356", 38, 9, "-99999999999999999711.387757642", "false"},
            {38, 18, "7.699974435E-9", 38, 9, "0.000000008", "false"},
            {38, 18, "-99999999999999889493.331817663390102654", 38, 9, "-99999999999999889493.331817663", "false"},
            {38, 18, "5E-18", 38, 9, "0", "false"},
            {38, 18, "774496813170.317368328960547916", 38, 9, "774496813170.317368329", "false"},
            {38, 18, "104245900285.847189475377927447", 38, 9, "104245900285.847189475", "false"},
            {38, 18, "-98937299508034012717.309826972022544188", 38, 9, "-98937299508034012717.309826972", "false"},
            {38, 18, "-99999999998503777756.960434951372825747", 38, 9, "-99999999998503777756.960434951", "false"},
            {38, 18, "-99999999999999999999.959981761048940340", 38, 9, "-99999999999999999999.959981761", "false"},
            {38, 18, "-99999999999999999999.999211457421913288", 38, 9, "-99999999999999999999.999211457", "false"},
            {38, 18, "-99999999999999999999.999999999999999998", 38, 9, "-100000000000000000000", "false"},
            {38, 18, "-99999999999999911711.777696574468428649", 38, 9, "-99999999999999911711.777696574", "false"},
            {38, 18, "0.000002510539762863", 38, 9, "0.000002511", "false"},
            {38, 18, "24149086815795.892079177047211875", 38, 9, "24149086815795.892079177", "false"},
            {38, 18, "2E-18", 38, 9, "0", "false"},
            {38, 18, "-99999999999999999999.999726940104040472", 38, 9, "-99999999999999999999.999726940", "false"},
            {38, 18, "64476.175354554619115331", 38, 9, "64476.175354555", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {
            {38, 18, "0.026072585735503528", 38, 13, "0.0260725857355", "false"},
            {38, 18, "764701753.701903133999233462", 38, 13, "764701753.7019031339992", "false"},
            {38, 18, "-99936961024807320697.832967402687693234", 38, 13, "-99936961024807320697.8329674026877",
             "false"},
            {38, 18, "-99999999999999999999.999999999999996663", 38, 13, "-100000000000000000000", "false"},
            {38, 18, "-99999999999999999999.999999999911731237", 38, 13, "-99999999999999999999.9999999999117",
             "false"},
            {38, 18, "-99999999999999999999.999999999995956462", 38, 13, "-99999999999999999999.9999999999960",
             "false"},
            {38, 18, "0.341364361127070716", 38, 13, "0.3413643611271", "false"},
            {38, 18, "32554.318815573114922736", 38, 13, "32554.3188155731149", "false"},
            {38, 18, "0.000027638976595697", 38, 13, "0.0000276389766", "false"},
            {38, 18, "-99999999999999999999.999999380361231425", 38, 13, "-99999999999999999999.9999993803612",
             "false"},
            {38, 18, "0.009374956792870293", 38, 13, "0.0093749567929", "false"},
            {38, 18, "-99999999999999999999.999999999979660198", 38, 13, "-99999999999999999999.9999999999797",
             "false"},
            {38, 18, "-99999999999999999999.113415565214059543", 38, 13, "-99999999999999999999.1134155652141",
             "false"},
            {38, 18, "2.35780769E-10", 38, 13, "0.0000000002358", "false"},
            {38, 18, "3.3725373E-11", 38, 13, "0.0000000000337", "false"},
            {38, 18, "-99999999999999999999.999999932814985737", 38, 13, "-99999999999999999999.9999999328150",
             "false"},
            {38, 18, "33626145207502594686.177899890687492277", 38, 13, "33626145207502594686.1778998906875", "false"},
            {38, 18, "-99999999999999999999.994834770266278024", 38, 13, "-99999999999999999999.9948347702663",
             "false"},
            {38, 18, "17.729906468337391657", 38, 13, "17.7299064683374", "false"},
            {38, 18, "-99999999999999999999.999999999985179194", 38, 13, "-99999999999999999999.9999999999852",
             "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {
            {38, 18, "-99999999999999999999.999999999999999998", 38, 18, "-99999999999999999999.999999999999999998",
             "false"},
            {38, 18, "-99999999999999999999.999999999999992193", 38, 18, "-99999999999999999999.999999999999992193",
             "false"},
            {38, 18, "5E-18", 38, 18, "0.000000000000000005", "false"},
            {38, 18, "3.0734520198E-8", 38, 18, "0.000000030734520198", "false"},
            {38, 18, "34157818772089981.580119564918270989", 38, 18, "34157818772089981.580119564918270989", "false"},
            {38, 18, "-99999999999999999999.999999978852350778", 38, 18, "-99999999999999999999.999999978852350778",
             "false"},
            {38, 18, "-99999999999999999888.372309275664859804", 38, 18, "-99999999999999999888.372309275664859804",
             "false"},
            {38, 18, "1.83E-16", 38, 18, "0.000000000000000183", "false"},
            {38, 18, "1806810930.876581513083713587", 38, 18, "1806810930.876581513083713587", "false"},
            {38, 18, "12770731995513.253416291297823140", 38, 18, "12770731995513.253416291297823140", "false"},
            {38, 18, "-99999982012799760460.149361972258192470", 38, 18, "-99999982012799760460.149361972258192470",
             "false"},
            {38, 18, "7365202.199175895663427534", 38, 18, "7365202.199175895663427534", "false"},
            {38, 18, "-99999999999999999999.999999999998620973", 38, 18, "-99999999999999999999.999999999998620973",
             "false"},
            {38, 18, "-99999999999999999999.999999999998724094", 38, 18, "-99999999999999999999.999999999998724094",
             "false"},
            {38, 18, "2.964470904E-9", 38, 18, "0.000000002964470904", "false"},
            {38, 18, "0.000786301167129039", 38, 18, "0.000786301167129039", "false"},
            {38, 18, "-99999999999999999999.999999138758037792", 38, 18, "-99999999999999999999.999999138758037792",
             "false"},
            {38, 18, "1.28362235E-10", 38, 18, "0.000000000128362235", "false"},
            {38, 18, "-99999999999999999999.999915182593379029", 38, 18, "-99999999999999999999.999915182593379029",
             "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal128p35s30Abnormal) {
    CastTestCaseArray test_cases = {{38, 18, "-99999999999999999884.185247814388390072", 35, 30, "", "true"},
                                    {38, 18, "280780529350605.360909175583214669", 35, 30, "", "true"},
                                    {38, 18, "221020907925349.889520134279104268", 35, 30, "", "true"},
                                    {38, 18, "-99999999999999999999.999999999999682039", 35, 30, "", "true"},
                                    {38, 18, "-99999999999999999821.152494329367030552", 35, 30, "", "true"},
                                    {38, 18, "-99999999999983224193.433293069622208770", 35, 30, "", "true"},
                                    {38, 18, "298695678.273521652328065000", 35, 30, "", "true"},
                                    {38, 18, "-99999999999999999999.678905458181566678", 35, 30, "", "true"},
                                    {38, 18, "-99999999999999990977.347082407010025711", 35, 30, "", "true"},
                                    {38, 18, "-61569371386415523205.559301468035431414", 35, 30, "", "true"},
                                    {38, 18, "-99999999999999999999.959218999269626864", 35, 30, "", "true"},
                                    {38, 18, "6541563992975531857.431159465426554444", 35, 30, "", "true"},
                                    {38, 18, "-99999999998616920710.397678287561368532", 35, 30, "", "true"},
                                    {38, 18, "56285345272183.963255706025244028", 35, 30, "", "true"},
                                    {38, 18, "3875785554180.903750701029483133", 35, 30, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p38s18ToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {
            {38, 18, "0.124529070177943806", 35, 30, "0.124529070177943806000000000000", "false"},
            {38, 18, "1.48144137E-10", 35, 30, "0.000000000148144137000000000000", "false"},
            {38, 18, "49.061664746742745389", 35, 30, "49.061664746742745389000000000000", "false"},
            {38, 18, "0.005615169415687579", 35, 30, "0.005615169415687579000000000000", "false"},
            {38, 18, "2.43664173E-10", 35, 30, "0.000000000243664173000000000000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal32p9s0Normal) {
    CastTestCaseArray test_cases = {{35, 30, "1.36958918622109142215E-10", 9, 0, "0", "false"},
                                    {35, 30, "-58816.539530768268312696284115892570", 9, 0, "-58817", "false"},
                                    {35, 30, "-77033.518411036144776691718326464516", 9, 0, "-77034", "false"},
                                    {35, 30, "7.130204534E-21", 9, 0, "0", "false"},
                                    {35, 30, "-99999.999999999999999999999999999914", 9, 0, "-100000", "false"},
                                    {35, 30, "-99999.999999999999999999834135881069", 9, 0, "-100000", "false"},
                                    {35, 30, "-99999.999999999998880488664591125376", 9, 0, "-100000", "false"},
                                    {35, 30, "-99999.999999999999999999147618064482", 9, 0, "-100000", "false"},
                                    {35, 30, "28915.167153012192572921790715754198", 9, 0, "28915", "false"},
                                    {35, 30, "23827.693879820694516748307994579359", 9, 0, "23828", "false"},
                                    {35, 30, "-99996.819008242153864570012593820477", 9, 0, "-99997", "false"},
                                    {35, 30, "3.5827640868944615729673E-8", 9, 0, "0", "false"},
                                    {35, 30, "-99999.999998632518219630191488961014", 9, 0, "-100000", "false"},
                                    {35, 30, "0.002246552102712701870383874998", 9, 0, "0", "false"},
                                    {35, 30, "0.002950367870225078066967497985", 9, 0, "0", "false"},
                                    {35, 30, "-99999.999999999999999999997345825157", 9, 0, "-100000", "false"},
                                    {35, 30, "8.743078420629354818E-12", 9, 0, "0", "false"},
                                    {35, 30, "-99999.999999999914538724607086675811", 9, 0, "-100000", "false"},
                                    {35, 30, "5.55452900179430E-16", 9, 0, "0", "false"},
                                    {35, 30, "1.218484010305701732278531763986", 9, 0, "1", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal32p9s2Normal) {
    CastTestCaseArray test_cases = {{35, 30, "1.18102E-25", 9, 2, "0", "false"},
                                    {35, 30, "0.186953716600657380155975658606", 9, 2, "0.19", "false"},
                                    {35, 30, "-99999.999999999999999999999999999945", 9, 2, "-100000", "false"},
                                    {35, 30, "93163.428161601126919044419553444909", 9, 2, "93163.43", "false"},
                                    {35, 30, "-99999.999693790315451906041558306482", 9, 2, "-100000", "false"},
                                    {35, 30, "-99999.999999999999999999999999999421", 9, 2, "-100000", "false"},
                                    {35, 30, "-99999.999999999999999999320929840481", 9, 2, "-100000", "false"},
                                    {35, 30, "-42773.526662726048703299861182456993", 9, 2, "-42773.53", "false"},
                                    {35, 30, "-99999.999999999999999999999999994558", 9, 2, "-100000", "false"},
                                    {35, 30, "3.1464707E-23", 9, 2, "0", "false"},
                                    {35, 30, "66.214377070894118880632880265134", 9, 2, "66.21", "false"},
                                    {35, 30, "-88321.628931868643287981709805915141", 9, 2, "-88321.63", "false"},
                                    {35, 30, "-99999.999999999999999999999896471717", 9, 2, "-100000", "false"},
                                    {35, 30, "1.17006544425995635759E-10", 9, 2, "0", "false"},
                                    {35, 30, "-99973.218827900657399193030459467924", 9, 2, "-99973.22", "false"},
                                    {35, 30, "0.228026028532179728688026303493", 9, 2, "0.23", "false"},
                                    {35, 30, "5.1301500473E-20", 9, 2, "0", "false"},
                                    {35, 30, "-10058.877928334965058489430793442903", 9, 2, "-10058.88", "false"},
                                    {35, 30, "-99999.999999999973125076574887622957", 9, 2, "-100000", "false"},
                                    {35, 30, "558.421454145358246008151427733986", 9, 2, "558.42", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal32p9s9Abnormal) {
    CastTestCaseArray test_cases = {{35, 30, "-99611.391713703775623522909765338003", 9, 9, "", "true"},
                                    {35, 30, "-99999.999999999999999999999999977451", 9, 9, "", "true"},
                                    {35, 30, "-99999.999996054215116818816668599921", 9, 9, "", "true"},
                                    {35, 30, "-99999.999999999999999999999999999993", 9, 9, "", "true"},
                                    {35, 30, "-99999.999999999999999999999986073081", 9, 9, "", "true"},
                                    {35, 30, "85438.089545444238392963764506821654", 9, 9, "", "true"},
                                    {35, 30, "-99999.999999644730189464485229927896", 9, 9, "", "true"},
                                    {35, 30, "785.434779528336441701930960745446", 9, 9, "", "true"},
                                    {35, 30, "-99999.999999999997688776286314760770", 9, 9, "", "true"},
                                    {35, 30, "1275.926129142751180187534166264230", 9, 9, "", "true"},
                                    {35, 30, "-99999.999999999999975755296156599613", 9, 9, "", "true"},
                                    {35, 30, "-99999.999999999999999999999999997532", 9, 9, "", "true"},
                                    {35, 30, "-90304.198652715349017409728514808711", 9, 9, "", "true"},
                                    {35, 30, "-99999.999999999999999999999933898042", 9, 9, "", "true"},
                                    {35, 30, "-99999.999999999999971514782976634112", 9, 9, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal32p9s9Normal) {
    CastTestCaseArray test_cases = {{35, 30, "4.8412950983012509556958E-8", 9, 9, "0.000000048", "false"},
                                    {35, 30, "0.000008193700142379249519634322", 9, 9, "0.000008194", "false"},
                                    {35, 30, "3.539822067E-21", 9, 9, "0", "false"},
                                    {35, 30, "4.7995322566842599156E-11", 9, 9, "0", "false"},
                                    {35, 30, "8.96516574825580E-16", 9, 9, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal32p7s4Normal) {
    CastTestCaseArray test_cases = {{35, 30, "1.3213492222024843E-14", 7, 4, "0", "false"},
                                    {35, 30, "-99999.999999999999999999508958875986", 7, 4, "-100000", "false"},
                                    {35, 30, "0.003386100457985959842114689014", 7, 4, "0.0034", "false"},
                                    {35, 30, "9.1736736405168E-17", 7, 4, "0", "false"},
                                    {35, 30, "-99999.999999999874094632011707876340", 7, 4, "-100000", "false"},
                                    {35, 30, "-99999.999999999970687553679970414120", 7, 4, "-100000", "false"},
                                    {35, 30, "3.9442711944121865838E-11", 7, 4, "0", "false"},
                                    {35, 30, "0.000086366524317870139319089047", 7, 4, "0.0001", "false"},
                                    {35, 30, "-54005.229380729615863950708820316138", 7, 4, "-54005.2294", "false"},
                                    {35, 30, "2.8564789981812E-17", 7, 4, "0", "false"},
                                    {35, 30, "-58816.539530768268312696284115892570", 7, 4, "-58816.5395", "false"},
                                    {35, 30, "2.528393413477243902E-12", 7, 4, "0", "false"},
                                    {35, 30, "-99999.999999999999999999999999999014", 7, 4, "-100000", "false"},
                                    {35, 30, "-99999.999999999666052891994361801323", 7, 4, "-100000", "false"},
                                    {35, 30, "-99999.999999999999999999999999945447", 7, 4, "-100000", "false"},
                                    {35, 30, "-99999.999999999999999999999999998848", 7, 4, "-100000", "false"},
                                    {35, 30, "-99920.254292119649169526573435455945", 7, 4, "-99920.2543", "false"},
                                    {35, 30, "4.5829801599E-20", 7, 4, "0", "false"},
                                    {35, 30, "3.0411429349367481649829E-8", 7, 4, "0", "false"},
                                    {35, 30, "-99999.999999999622153064148437037238", 7, 4, "-100000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL32>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal64p18s0Normal) {
    CastTestCaseArray test_cases = {{35, 30, "-1701.993163352271348536657403956238", 18, 0, "-1702", "false"},
                                    {35, 30, "-52630.792577373302049995055106146306", 18, 0, "-52631", "false"},
                                    {35, 30, "-99999.999999999999999604786607340373", 18, 0, "-100000", "false"},
                                    {35, 30, "1.07935991572459008E-13", 18, 0, "0", "false"},
                                    {35, 30, "4.0525611835E-20", 18, 0, "0", "false"},
                                    {35, 30, "-99999.999999691327401799850958647654", 18, 0, "-100000", "false"},
                                    {35, 30, "-99999.999999901197571101400465809552", 18, 0, "-100000", "false"},
                                    {35, 30, "-39284.620999135740878713687286553074", 18, 0, "-39285", "false"},
                                    {35, 30, "41183.460469231731687303715884107428", 18, 0, "41183", "false"},
                                    {35, 30, "-99999.999999999870357699420296760199", 18, 0, "-100000", "false"},
                                    {35, 30, "-99999.999999544050037103749390389848", 18, 0, "-100000", "false"},
                                    {35, 30, "-99999.999999999999999999999996175645", 18, 0, "-100000", "false"},
                                    {35, 30, "-81120.274202974474418568042691198726", 18, 0, "-81120", "false"},
                                    {35, 30, "-99999.999999999999999999999999999992", 18, 0, "-100000", "false"},
                                    {35, 30, "-99999.999999999874792658748990651495", 18, 0, "-100000", "false"},
                                    {35, 30, "-99999.999999996849300231816766956751", 18, 0, "-100000", "false"},
                                    {35, 30, "6.1188330636589775655551E-8", 18, 0, "0", "false"},
                                    {35, 30, "8.73E-28", 18, 0, "0", "false"},
                                    {35, 30, "2.30150611422675843765E-10", 18, 0, "0", "false"},
                                    {35, 30, "1.1157E-26", 18, 0, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal64p18s2Normal) {
    CastTestCaseArray test_cases = {{35, 30, "9.478477621684407235E-12", 18, 2, "0", "false"},
                                    {35, 30, "3.61398646484301194133E-10", 18, 2, "0", "false"},
                                    {35, 30, "-99999.999999999999999999999999875530", 18, 2, "-100000", "false"},
                                    {35, 30, "-99998.787260913570790736801821036600", 18, 2, "-99998.79", "false"},
                                    {35, 30, "6.8275741372078E-17", 18, 2, "0", "false"},
                                    {35, 30, "-99995.019129528403500773950366653927", 18, 2, "-99995.02", "false"},
                                    {35, 30, "-99999.999999999999999947646796950241", 18, 2, "-100000", "false"},
                                    {35, 30, "-99999.999999948709526803317627414414", 18, 2, "-100000", "false"},
                                    {35, 30, "-99999.999999999999999981389047349964", 18, 2, "-100000", "false"},
                                    {35, 30, "5.9592159695E-20", 18, 2, "0", "false"},
                                    {35, 30, "617.324681918806537302727348153172", 18, 2, "617.32", "false"},
                                    {35, 30, "-69398.332555659269543621948912907219", 18, 2, "-69398.33", "false"},
                                    {35, 30, "0E-30", 18, 2, "0", "false"},
                                    {35, 30, "-99999.999999999999999999999999999997", 18, 2, "-100000", "false"},
                                    {35, 30, "37140.327595087213448811338708206231", 18, 2, "37140.33", "false"},
                                    {35, 30, "3.4630559308391E-17", 18, 2, "0", "false"},
                                    {35, 30, "-99999.999937189948546128366721735351", 18, 2, "-100000", "false"},
                                    {35, 30, "-99999.999999999999999999993636286655", 18, 2, "-100000", "false"},
                                    {35, 30, "1.28E-28", 18, 2, "0", "false"},
                                    {35, 30, "0.000594861995043316426882890990", 18, 2, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal64p18s9Normal) {
    CastTestCaseArray test_cases = {
            {35, 30, "8.38E-28", 18, 9, "0", "false"},
            {35, 30, "-99999.999999999999993256827016901145", 18, 9, "-100000", "false"},
            {35, 30, "-99999.986039611602558319384145952925", 18, 9, "-99999.986039612", "false"},
            {35, 30, "1.64114842039E-19", 18, 9, "0", "false"},
            {35, 30, "7.92472512088956781E-13", 18, 9, "0", "false"},
            {35, 30, "2.435816818308696899366022956843", 18, 9, "2.435816818", "false"},
            {35, 30, "1.061053836149703924376452393510", 18, 9, "1.061053836", "false"},
            {35, 30, "1.398584459E-21", 18, 9, "0", "false"},
            {35, 30, "1983.934601977197553827867142418057", 18, 9, "1983.934601977", "false"},
            {35, 30, "-98728.108698791169015880689954129628", 18, 9, "-98728.108698791", "false"},
            {35, 30, "0.740577100500828168615249258427", 18, 9, "0.740577101", "false"},
            {35, 30, "0.007397086451059510845771078093", 18, 9, "0.007397086", "false"},
            {35, 30, "1.975879309E-21", 18, 9, "0", "false"},
            {35, 30, "-99999.999723032734242658374689537713", 18, 9, "-99999.999723033", "false"},
            {35, 30, "5.8657270E-23", 18, 9, "0", "false"},
            {35, 30, "-99999.999999996369439389754985654922", 18, 9, "-99999.999999996", "false"},
            {35, 30, "-99999.978351699221464589744514160569", 18, 9, "-99999.978351699", "false"},
            {35, 30, "3.19503E-25", 18, 9, "0", "false"},
            {35, 30, "-99999.999649396094904025901832702134", 18, 9, "-99999.999649396", "false"},
            {35, 30, "-99999.999429153958591884593779476588", 18, 9, "-99999.999429154", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal64p18s18Abnormal) {
    CastTestCaseArray test_cases = {{35, 30, "-99999.999999999999476074685355119844", 18, 18, "", "true"},
                                    {35, 30, "-99999.999999999999998888528170054828", 18, 18, "", "true"},
                                    {35, 30, "-99999.840660909871556421130419520921", 18, 18, "", "true"},
                                    {35, 30, "-99999.999999999999999999999999993301", 18, 18, "", "true"},
                                    {35, 30, "-99999.999999999999827098318013499643", 18, 18, "", "true"},
                                    {35, 30, "-60619.636512979619523373803630163011", 18, 18, "", "true"},
                                    {35, 30, "-99999.999999999999999999920768658744", 18, 18, "", "true"},
                                    {35, 30, "-99999.999999999999710265543768249975", 18, 18, "", "true"},
                                    {35, 30, "-99999.999999999999999999999999893574", 18, 18, "", "true"},
                                    {35, 30, "-99999.999999999999999999999999999998", 18, 18, "", "true"},
                                    {35, 30, "-99999.999999999999999999999999982425", 18, 18, "", "true"},
                                    {35, 30, "85.462901639869275204073349370155", 18, 18, "", "true"}};
    test_cast_all_fail<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal64p18s18Normal) {
    CastTestCaseArray test_cases = {
            {35, 30, "4.64636759884826383E-13", 18, 18, "0.000000000000464637", "false"},
            {35, 30, "6.251E-27", 18, 18, "0", "false"},
            {35, 30, "0.014954930171229015080261227852", 18, 18, "0.014954930171229015", "false"},
            {35, 30, "2.033E-27", 18, 18, "0", "false"},
            {35, 30, "0E-30", 18, 18, "0", "false"},
            {35, 30, "2.19141121263954020E-13", 18, 18, "0.000000000000219141", "false"},
            {35, 30, "7.81881568402984E-16", 18, 18, "0.000000000000000782", "false"},
            {35, 30, "1.3110829E-23", 18, 18, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal64p15s13Normal) {
    CastTestCaseArray test_cases = {
            {35, 30, "3.0975907719059111801E-11", 15, 13, "0.0000000000310", "false"},
            {35, 30, "1.946906954E-21", 15, 13, "0", "false"},
            {35, 30, "2.75174E-25", 15, 13, "0", "false"},
            {35, 30, "-99999.999999999999999999999999957105", 15, 13, "-100000", "false"},
            {35, 30, "0.000002313742076559087989463669", 15, 13, "0.0000023137421", "false"},
            {35, 30, "-99974.407534245134959137508946520852", 15, 13, "-99974.4075342451350", "false"},
            {35, 30, "0.002713438712372274289337316259", 15, 13, "0.0027134387124", "false"},
            {35, 30, "-90884.204259585740894040875835114281", 15, 13, "-90884.2042595857409", "false"},
            {35, 30, "1E-30", 15, 13, "0", "false"},
            {35, 30, "-99982.657167546017849208778295649708", 15, 13, "-99982.6571675460178", "false"},
            {35, 30, "2.02907276663957448E-13", 15, 13, "0.0000000000002", "false"},
            {35, 30, "-33460.971799288089052603311315279936", 15, 13, "-33460.9717992880891", "false"},
            {35, 30, "6.900E-27", 15, 13, "0", "false"},
            {35, 30, "-99999.488708120127803017073962135167", 15, 13, "-99999.4887081201278", "false"},
            {35, 30, "-99999.998888764018275796042578879182", 15, 13, "-99999.9988887640183", "false"},
            {35, 30, "2.927143411684E-18", 15, 13, "0", "false"},
            {35, 30, "4.62400591133644078353E-10", 15, 13, "0.0000000004624", "false"},
            {35, 30, "-99999.999999999999999999999999998954", 15, 13, "-100000", "false"},
            {35, 30, "-99999.995294206353327398756465958997", 15, 13, "-99999.9952942063533", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL64>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal128p38s0Normal) {
    CastTestCaseArray test_cases = {{35, 30, "-99999.999999925917678713809193772589", 38, 0, "-100000", "false"},
                                    {35, 30, "-99999.999999999998334454755469179958", 38, 0, "-100000", "false"},
                                    {35, 30, "-99999.990503864732910209573736477880", 38, 0, "-100000", "false"},
                                    {35, 30, "1.4648321751452593518663E-8", 38, 0, "0", "false"},
                                    {35, 30, "-58816.539530768268312696284115892570", 38, 0, "-58817", "false"},
                                    {35, 30, "37333.478096826672080014591282868414", 38, 0, "37333", "false"},
                                    {35, 30, "39377.624689646029116678257191317332", 38, 0, "39378", "false"},
                                    {35, 30, "72.912957125515634554207413421112", 38, 0, "73", "false"},
                                    {35, 30, "-99999.999999999999999999999999999900", 38, 0, "-100000", "false"},
                                    {35, 30, "-99999.999999999068826848572658418596", 38, 0, "-100000", "false"},
                                    {35, 30, "0.001212363970182151966601614499", 38, 0, "0", "false"},
                                    {35, 30, "-99999.999999999999999982739801443356", 38, 0, "-100000", "false"},
                                    {35, 30, "-99961.244224311891773062239419762665", 38, 0, "-99961", "false"},
                                    {35, 30, "-58440.666360593421648918455773270758", 38, 0, "-58441", "false"},
                                    {35, 30, "-99999.999999421093255102618344549857", 38, 0, "-100000", "false"},
                                    {35, 30, "4.006521261082680E-15", 38, 0, "0", "false"},
                                    {35, 30, "-99999.999999999999999999999999999963", 38, 0, "-100000", "false"},
                                    {35, 30, "-99999.999935902114053594129474441087", 38, 0, "-100000", "false"},
                                    {35, 30, "4.717888439711E-18", 38, 0, "0", "false"},
                                    {35, 30, "-99999.999638060171608921359941910330", 38, 0, "-100000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal128p38s2Normal) {
    CastTestCaseArray test_cases = {{35, 30, "-98001.889592009524659300841288078992", 38, 2, "-98001.89", "false"},
                                    {35, 30, "-99999.898564252329999200612980480945", 38, 2, "-99999.90", "false"},
                                    {35, 30, "-99999.999999999999537334288895296395", 38, 2, "-100000", "false"},
                                    {35, 30, "-56678.268461109618255043555035499428", 38, 2, "-56678.27", "false"},
                                    {35, 30, "-62016.689506102842908625031565228353", 38, 2, "-62016.69", "false"},
                                    {35, 30, "-99999.999999999999945988963223113418", 38, 2, "-100000", "false"},
                                    {35, 30, "36485.318710502620580678743413461168", 38, 2, "36485.32", "false"},
                                    {35, 30, "-99999.999999999999999999999970437128", 38, 2, "-100000", "false"},
                                    {35, 30, "2.32889109E-22", 38, 2, "0", "false"},
                                    {35, 30, "-56373.563384746989180141573354307689", 38, 2, "-56373.56", "false"},
                                    {35, 30, "0.000018613645775221750177949439", 38, 2, "0", "false"},
                                    {35, 30, "3.544030613841058372E-12", 38, 2, "0", "false"},
                                    {35, 30, "1.557E-27", 38, 2, "0", "false"},
                                    {35, 30, "-99999.999999999999999959973250902394", 38, 2, "-100000", "false"},
                                    {35, 30, "-57359.792328920080518197618402725494", 38, 2, "-57359.79", "false"},
                                    {35, 30, "-99999.998273741735979159644993063242", 38, 2, "-100000", "false"},
                                    {35, 30, "7.29510265E-22", 38, 2, "0", "false"},
                                    {35, 30, "-99999.999999914060601588958737354024", 38, 2, "-100000", "false"},
                                    {35, 30, "1.6719539753620857496414E-8", 38, 2, "0", "false"},
                                    {35, 30, "2.0501757E-23", 38, 2, "0", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal128p38s9Normal) {
    CastTestCaseArray test_cases = {
            {35, 30, "11260.406730558422274617573887102018", 38, 9, "11260.406730558", "false"},
            {35, 30, "-99999.999999999999999999999999999671", 38, 9, "-100000", "false"},
            {35, 30, "1.4558401807421178678546E-8", 38, 9, "0.000000015", "false"},
            {35, 30, "1.92071752E-22", 38, 9, "0", "false"},
            {35, 30, "0.005916521493131566247279133959", 38, 9, "0.005916521", "false"},
            {35, 30, "0.726563738340278531700963470019", 38, 9, "0.726563738", "false"},
            {35, 30, "-53859.796237379879008903742438053397", 38, 9, "-53859.796237380", "false"},
            {35, 30, "64223.728823784327609421882663363670", 38, 9, "64223.728823784", "false"},
            {35, 30, "-99999.999999999999105713510954669976", 38, 9, "-100000", "false"},
            {35, 30, "1.0572897479319869076E-11", 38, 9, "0", "false"},
            {35, 30, "-99999.999999999999999960306724912926", 38, 9, "-100000", "false"},
            {35, 30, "-99999.999999999999999999999999999975", 38, 9, "-100000", "false"},
            {35, 30, "3.9889251827643942E-14", 38, 9, "0", "false"},
            {35, 30, "-27723.965727326850341348876814207802", 38, 9, "-27723.965727327", "false"},
            {35, 30, "15145.032083553679588807695912087840", 38, 9, "15145.032083554", "false"},
            {35, 30, "50807.619063922930883469317216777720", 38, 9, "50807.619063923", "false"},
            {35, 30, "-99999.999998855156223484579485168982", 38, 9, "-99999.999998855", "false"},
            {35, 30, "5.6748067411550851E-14", 38, 9, "0", "false"},
            {35, 30, "25268.245624027590438493095021514955", 38, 9, "25268.245624028", "false"},
            {35, 30, "-99999.999943322832521712708671818152", 38, 9, "-99999.999943323", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal128p38s13Normal) {
    CastTestCaseArray test_cases = {
            {35, 30, "-99999.999999999999999991939683510244", 38, 13, "-100000", "false"},
            {35, 30, "-99999.999999999999999999999998386106", 38, 13, "-100000", "false"},
            {35, 30, "-37222.287842691582535292308734905729", 38, 13, "-37222.2878426915825", "false"},
            {35, 30, "-99999.999999999999999983954669638923", 38, 13, "-100000", "false"},
            {35, 30, "-99999.999999999999999999623059494066", 38, 13, "-100000", "false"},
            {35, 30, "-99999.999999999999999999999999986824", 38, 13, "-100000", "false"},
            {35, 30, "-99999.999999999999999999999999999806", 38, 13, "-100000", "false"},
            {35, 30, "-65312.647753195680256211992758513123", 38, 13, "-65312.6477531956803", "false"},
            {35, 30, "1.01692485804767254400E-10", 38, 13, "0.0000000001017", "false"},
            {35, 30, "-99999.999999999999999999494300259442", 38, 13, "-100000", "false"},
            {35, 30, "-99999.999999999974984079071167585670", 38, 13, "-99999.9999999999750", "false"},
            {35, 30, "-95062.984308273610657353100017238498", 38, 13, "-95062.9843082736107", "false"},
            {35, 30, "3.1358771E-23", 38, 13, "0", "false"},
            {35, 30, "-99999.999974989950223929040517411865", 38, 13, "-99999.9999749899502", "false"},
            {35, 30, "-99999.999984577883733847912405112346", 38, 13, "-99999.9999845778837", "false"},
            {35, 30, "7.304520E-24", 38, 13, "0", "false"},
            {35, 30, "5E-30", 38, 13, "0", "false"},
            {35, 30, "-56705.326202816465014803688666707462", 38, 13, "-56705.3262028164650", "false"},
            {35, 30, "-99999.999999999999999999999999999998", 38, 13, "-100000", "false"},
            {35, 30, "-99999.999999999999999999999999889940", 38, 13, "-100000", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal128p38s18Normal) {
    CastTestCaseArray test_cases = {
            {35, 30, "-99999.999999999943663561539012569042", 38, 18, "-99999.999999999943663562", "false"},
            {35, 30, "-57530.372191054890300495167196065945", 38, 18, "-57530.372191054890300495", "false"},
            {35, 30, "-79268.051211340348808094285630000822", 38, 18, "-79268.051211340348808094", "false"},
            {35, 30, "0.057342159928325431270431970330", 38, 18, "0.057342159928325431", "false"},
            {35, 30, "3.85133046364655266E-13", 38, 18, "0.000000000000385133", "false"},
            {35, 30, "-99999.999979599077738399112585930148", 38, 18, "-99999.999979599077738399", "false"},
            {35, 30, "-99999.999999999999999999999999997054", 38, 18, "-100000", "false"},
            {35, 30, "1.534101310744445492820271223076", 38, 18, "1.534101310744445493", "false"},
            {35, 30, "0.000001800984827468543585740933", 38, 18, "0.000001800984827469", "false"},
            {35, 30, "1E-30", 38, 18, "0", "false"},
            {35, 30, "82681.809901197273837825668113203859", 38, 18, "82681.809901197273837826", "false"},
            {35, 30, "9.8670690588334735E-14", 38, 18, "0.000000000000098671", "false"},
            {35, 30, "-99999.999999999999992169245736054705", 38, 18, "-99999.999999999999992169", "false"},
            {35, 30, "-86406.282384842414824834371471508052", 38, 18, "-86406.282384842414824834", "false"},
            {35, 30, "-99999.995665091100263383731555533288", 38, 18, "-99999.995665091100263384", "false"},
            {35, 30, "-81527.237050477620912607399293984513", 38, 18, "-81527.237050477620912607", "false"},
            {35, 30, "0.000088033763825524160258026032", 38, 18, "0.000088033763825524", "false"},
            {35, 30, "-8114.796258354522694739522330327427", 38, 18, "-8114.796258354522694740", "false"},
            {35, 30, "8.9120E-26", 38, 18, "0", "false"},
            {35, 30, "0.149537645786522794795771679052", 38, 18, "0.149537645786522795", "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}

PARALLEL_TEST(VectorizedDecimalCastExprDecimalTest, testCastFromDecimal128p35s30ToDecimal128p35s30Normal) {
    CastTestCaseArray test_cases = {
            {35, 30, "2.95630E-25", 35, 30, "0.000000000000000000000000295630", "false"},
            {35, 30, "-99838.150015993576088212976251521339", 35, 30, "-99838.150015993576088212976251521339", "false"},
            {35, 30, "7.623503312625E-18", 35, 30, "0.000000000000000007623503312625", "false"},
            {35, 30, "3.84771007E-22", 35, 30, "0.000000000000000000000384771007", "false"},
            {35, 30, "2.7312438E-23", 35, 30, "0.000000000000000000000027312438", "false"},
            {35, 30, "177.327805577042880776757928222757", 35, 30, "177.327805577042880776757928222757", "false"},
            {35, 30, "-99999.999999999969928465569996229218", 35, 30, "-99999.999999999969928465569996229218", "false"},
            {35, 30, "-99999.999999999999982927357918990406", 35, 30, "-99999.999999999999982927357918990406", "false"},
            {35, 30, "1.672941E-24", 35, 30, "0.000000000000000000000001672941", "false"},
            {35, 30, "2.7346E-26", 35, 30, "0.000000000000000000000000027346", "false"},
            {35, 30, "-99999.999999999999999999999999088401", 35, 30, "-99999.999999999999999999999999088401", "false"},
            {35, 30, "-99992.155665304094942787643781568667", 35, 30, "-99992.155665304094942787643781568667", "false"},
            {35, 30, "-99999.999999969168965900503259708124", 35, 30, "-99999.999999969168965900503259708124", "false"},
            {35, 30, "-99998.979791507737230880434849908385", 35, 30, "-99998.979791507737230880434849908385", "false"},
            {35, 30, "81421.576922608402012287437223945317", 35, 30, "81421.576922608402012287437223945317", "false"},
            {35, 30, "-99999.999999999999999973740623954726", 35, 30, "-99999.999999999999999973740623954726", "false"},
            {35, 30, "-99999.950115562514545759974458645774", 35, 30, "-99999.950115562514545759974458645774", "false"},
            {35, 30, "0.000038186442426346840497892019", 35, 30, "0.000038186442426346840497892019", "false"},
            {35, 30, "1.260E-27", 35, 30, "0.000000000000000000000000001260", "false"},
            {35, 30, "-99992.727883745060580167357249108602", 35, 30, "-99992.727883745060580167357249108602",
             "false"}};
    test_cast_all<TYPE_DECIMAL128, TYPE_DECIMAL128>(test_cases);
}
} // namespace starrocks::vectorized
